Sayyiduna Hudhayfah (may Allah be pleased with him) narrates that (once) I and the Messenger of Allah (peace and blessings be upon him) were walking when we reached a garbage dump of a people (which) was behind a wall. The Prophet stood in such a way as any one of you would stand, then he urinated. I moved aside, but he signaled to me, so I stood near his heels (for the purpose of providing cover) until he finished urinating.
Hadith Referenceاللؤلؤ والمرجان / كتاب الطهارة / 156
Hadith Gradingمحدثین:«صحیح»
Hadith Takhrij«صحیح، أخرجه البخاري في: 4 كتاب الوضوء: 61 باب البول عند صاحبه والتستر بالحائط»
Brief Explanation
The thing that should be kept in mind while relieving oneself is to avoid splashes. Thus, in normal circumstances, this is possible only by sitting, whereas in certain special situations, one can avoid splashes by standing. Therefore, if sitting is difficult and troublesome, or if one can be cautious while urinating standing up, then there is no harm in urinating while standing. However, in ordinary circumstances, one should urinate while sitting.