Squeeze the urethra (it runs along the bottom of the penis) from perineum (from behind the scrotum) up to tip of the penis after you finish peeing. That’ll get the last of the urine out of your urethra so it won’t end up in your pants, which will probably solve the problem. Unless you’re incontinent, but that’s a different situation and if you suspect that, it probably deserves a trip to the doctor.
Edit history
Squeeze the urethra (it runs along the bottom of the penis) from perineum up to tip after you finish peeing. That’ll probably solve it. Unless you’re incontinent, but yeah.