It was narrated from Jabir bin `Abdullah that:
"A man passed by the Prophet while he was urinating, and greeted him by the Salam. The Messenger of Allah said to him: "If you see me in this situation, do not greet me with the Salam, for if you do that I will not respond to you.'"
English reference: Vol. 1, Book 1, Hadith 352
Arabic reference: Book 1, Hadith 380
Read hadith from the major collections in the app, with prayer times and a Qibla compass. Free.