Abu Musa Al-Ash'ari (May Allah be pleased with him) reported:
The Messenger of Allah (ﷺ) said, "Permission is to be sought thrice. If it is accorded, you may enter; otherwise, go back."[Al- Bukhari and Muslim]. (ID)
App reference (ID): Book 6, Hadith 26 (ID)
Arabic/English book reference (ID): Book 6, Hadith 870 (ID)