The Messenger of Allah said: "No two people should converse while relieving themselves…

Sunan Ibn Majah Book 1 Hadith 366

Sunan Ibn Majah

The Book of Purification and its Sunnah 1:366

It was narrated from Abu Sa`eed al-Khudri that:

The Messenger of Allah said: "No two people should converse while relieving themselves, each of them looking at the private parts of the other, for Allah, the Mighty and Sublime, hates that." (Da'if)Other chains with similar wording.