When you come to someone’s house, you have to ask permission to the owner of the house to enter. When you try it and there is no answer, then you may repeat that until 3 times. If still no answer, then you better go back home.
In a hadith from Abu Musa al-Ash’ari (may Allah blesses him), that the Messenger of Allah (ﷺ) says,
الاستئذان ثلاث، فإن أذن لك وإلا فارجع
“Permission is to be sought thrice. If permission is granted, you may enter; otherwise, go back” [al-Bukhari and Muslim].
Al Munawi explains this hadith:
أي طلب الأذن في الدخول وكرره ثلاث مرات بالقول أو بقرع الباب قرعا خفيفا (فلم يؤذن له) فيه (فليرجع) وجوبا إن غلب على ظنه أنه سمعه وإلا فندبا
“That is, if someone asks for permission to enter a house, then he repeats it three times by saying or by knocking at the door lightly. Then if he is not authorized, so he should back home. He have to back home, if he thinks the house owner may hear him. But, if thinks the owner doesn’t hear him, he is encouraged to go back home, but not obliged” [Faidhul Qadir, 1:273].
Donate whatever you can to ussunnah.org/orphan and may Allah return it to you even more. Aameen.