It was narrated that Ibn 'Umar said:
"A man passed by the Prophet (ﷺ) when he was urinating and greeted him with Salam, but he did not return his greeting." (ES)
Arabic/English book reference (ES): Vol. 1, Book 1, Hadith 37 (ES)