In public restrooms, the general etiquette for using the stall to pee when all the urinals are occupied is to leave the stall door closed. Closing the stall door provides you with privacy while using the restroom, just like if you were using the stall for other purposes. This way, other people using the restroom won't accidentally see you and will be aware that the stall is occupied.
Leaving the stall door closed is a courteous gesture to ensure everyone's comfort and privacy in a public restroom setting. It's a simple and considerate action to follow when all the urinals are being used.