The Messenger of Allah ﷺ said, "It is not lawful for a Muslim to look into the interior of another person's house without first seeking permission. If he looks in, it is as though he has entered. Nor should anyone lead a congregation in prayer and single himself out with a supplication that excludes them, for if he does so, he has betrayed them. And no one should pray while needing to relieve himself until he has done so."
حدثنا الحكم بن نافع حدثنا إسماعيل بن عياش عن حبيب بن صالح عن يزيد بن شريح الحضرمي عن أبي حي المؤذن
عن رسول الله ﷺ أنه قال لا يحل لامرئ من المسلمين أن ينظر في جوف بيت امرئ حتى يستأذن فإن نظر فقد دخل ولا يؤم قوما فيختص نفسه بدعاء دونهم فإن فعل فقد خانهم ولا يصل وهو حقن حتى يتخفف