Fainting while urinating standing up, particularly just after waking, is quite common for men.
The medical term is micturition syncope. Micturition is the tecnical term for "emptying the bladder" and syncope the term used for fainting as a result of reduced blood flow to the brain.
When you sleep you have a lower than normal blood pressure because your veins are dilated due to lowered nerve activity. When you get up at night to pass water, the nerves should "kick in" and cause the veins to contract and push up your blood pressure.
When you pass water, the nerve stimulation involved in relaxing the bladder sphincter and contracting the bladder may lead to a fall in blood pressure, even in "normal" people.
In micturition syncope the blood pressure doesn't normalise fully when the person gets up, and when that person then starts to pass water he passes out.
The best would be to have your blood pressure taken, to make sure that you don't have an irregular heartbeat and that you aren't anaemic and that there are no underlying diseases.
Other factors that could cause micturition syncope include dehydration, excessive alcohol intake, medical conditions such as a respiratory infection and the use of certain medications, including alpha blockers that improve urination in men with prostate problems.
If a man has micturition syncope, he should just remember to sit on the bed for 1-3 minutes before walking to the bathroom. It's also a good idea to urinate sitting down.
Fainting could be a sign of heart trouble
What you need to know about kidney and bladder disorders