Abu Musa Al-Ash'ari (May Allah be pleased with him) reported: The Messenger of Allah ﷺ said, "Permission is to be sought thrice. If permission is granted, you may enter; otherwise, go back". Al- Bukhari and Muslim.
The Prophet Muhammad ﷺ taught us that it is polite to ask for permission three times before entering someone’s house, and if the person does not grant you access then you should go back. This teaches us the importance of respecting other people’s privacy and being mindful when visiting them in their homes or any other private space. We can also learn from this hadith that we should always be humble when asking for something from another person, even if it’s something as simple as asking to enter a room or house.