I was with the Prophet ﷺ when he came to the refuse heap of a people, and he urinated while standing. I moved away, but he said, "Come closer."So I came closer until I stood near his heels. Then he performed ablution and wiped over his leather socks.
كنت مع النبي ﷺ فانتهى إلى شباط قوم، فبال قائما، فتنحيت، فقال: ادنه، فدنوت حتى قمت عند عقبيه، فتوضأ، فمسح على خفيه.
Bukhari narrated it in the chapter on wudu (224, 225) via the route of Shuba, and Muslim in the chapter on purification (273) via the route of Abu Khaythama, both of them from Amash, from Abu Waail, from Huzaifa, who related it. The wording given is that of Muslim, while Bukhari did not mention "then he wiped over his socks." This is the sahih version of Huzaifa's hadith.As for what Ibn Majah narrated (306) via the route of Shuba, from Asim, from Abu Waail, from Mughira bin Shuba, "that the Prophet ﷺ came to a rubbish heap belonging to some people and urinated standing," Shuba said, "Asim said on that occasion, this is how Amash narrates it, from Abu Waail, from Huzaifa," meaning as Amash had said. Mansur then corroborated Amash in his narration from Abu Waail, from Huzaifa. This exposed the error of Asim in narrating this hadith from Abu Waail, from Mughira bin Shuba.Tirmidhi gave preference to the narration of Abu Waail from Huzaifa over his narration from Mughira. Hafiz said in Fath al-Bari (1/329), "This is as he said, even though Ibn Khuzayma leaned toward regarding both narrations as sahih, since Hammad bin Abu Sulayman agreed with Asim in saying 'from Mughira,' making it possible that Abu Waail heard it from both of them, so that both versions would be valid together. However, in terms of preference, the narration of Amash and Mansur, given their agreement, is more sahih than the narration of Asim and Hammad, since there is some question regarding the reliability of their memory." End of quote.As for the statement "he urinated standing," the Prophet's ﷺ usual practice and guidance was that he would urinate sitting, so perhaps he urinated standing on this occasion to demonstrate that it is permissible, given that he was safe from being splashed by the urine, since the rubbish heap was soft ground, so the urine would not splash back onto the one urinating. Regarding the prohibition against urinating while standing, Tirmidhi said, "It is for the sake of good manners, not because it is forbidden. It has been narrated from Abdullah bin Masud that he said, 'It is a form of rudeness for you to urinate while standing.'" End of quote.Ayesha reported what she knew of the Prophet's ﷺ practice inside his house, and Huzaifa's hadith does not contradict this, because he reported what the Prophet ﷺ did outside the house. The "rubbish heap belonging to some people" refers to a place where rubbish, dirt, and similar things are dumped.As for what was reported from Jabir bin Abdullah, who said, "The Messenger of Allah ﷺ forbade urinating while standing," this is not sahih. Ibn Majah narrated it (309) via the route of Adi bin Fadl, from Ali bin Hakam, from Abu Nadra, from Jabir bin Abdullah, who related it. Its chain is extremely daif, for Adi bin Fadl Taymi, Abu Hatim Basri, is discarded as a narrator, as Abu Hatim said, and Abu Zura abandoned his hadith, and Ibn Main, Nasai, and others declared him daif. He has no hadith in the six books except this single one, found in Ibn Majah.