In space humans pee in same way as they do on earth the only difference is that they have different kinds of toilet in space.
A space toilet built by NASA actually costs 23 Million dollars. This toilet is special in many ways, this toilet works on the principle of suction because in space everything seems to float. If you try to pee in a normal toilet in space your pee may fly and stick to your face that’s disgusting right? yes, it is. But these things will not happen in this space toilet because this toilet will suck your pee so that it does not fly.
To pee, astronauts use a funnel attached to a hose that uses a fan to pull the urine into a tankCitation: https://www.smithsonianmag.com/science-nature/nasa-just-sent-new-23-million-space-toilet-international-space-station-180976037/
This new toilet can accommodate both male and female astronauts.
Do you know that your pee eventually get recycled in space for water.
UWMS which is NASA’s new space toilet uses air flow to pull urine and feces away from astronauts body. These toilets are designed in such a way that it requires less maintenance and cleaning up.