Sayyiduna Hudhayfah (may Allah be pleased with him) narrates: I saw the Prophet Muhammad (peace and blessings be upon him) come to a garbage heap. He stood and urinated there, then he asked for water and performed ablution, wiping over his leather socks. (Imam Ibn Hibban, may Allah have mercy on him, says:) In this action, there was no specific reason. It was not possible that the Prophet (peace and blessings be upon him) came to a garbage heap, which was filthy. He intended to urinate there, but (to sit and urinate) was also not possible because when a person sits to urinate in a place that is somewhat elevated, there is a risk that the urine will spread and may return towards the person. So, due to the impossibility of sitting to relieve himself, the Prophet (peace and blessings be upon him) urinated while standing.
Hadith Referenceصحیح ابن حبان / كتاب الطهارة / 1425
Hadith Gradingفضيلة الشيخ الإمام محمد ناصر الدين الألبانيصحيح.فضيلة الشيخ العلّامة شُعيب الأرناؤوطإسناده صحيح على شرطهما، أبو عوانة: هو الوضاح بن عبد الله اليشكري.