To be able to get pregnant the sperm that goes inside the woman must stay in the woman long enough to fertilize the egg.
When you have sex the sperm will stay inside the vagina until it does fertilize the egg so the sperm should not come out of your vagina even when you pee.
Usually the sperm will get to the egg within minutes of having sex.
The sperm however can live up to 5 days inside your vagina and sometimes it takes awhile for the sperm to fertilize the egg.
If you're a man and you have sex even a few days before your partner ovulates, there's a good chance that the woman will get pregnant.