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]. (ES)
App reference (ES): Book 6, Hadith 26 (ES)
Arabic/English book reference (ES): Book 6, Hadith 870 (ES)