Muwatta Imam Malik Book of General Subjects, Hadith 2
Malik related to me from a reliable source of his from Bukayr ibn Abdullah ibn al-Ashajj from Basr ibn Said from Abu Said al-Khudri that Abu Musa al-Ashari said, "The Messenger of Allah ﷺ said, 'One asks permission three times. If you are given permission, then enter. If not, go away.' "
وَحَدَّثَنِي مَالِكٌ، عَنِ الثِّقَةِ، عِنْدَهُ عَنْ بُكَيْرِ بْنِ عَبْدِ اللَّهِ بْنِ الأَشَجِّ، عَنْ بُسْرِ بْنِ سَعِيدٍ، عَنْ أَبِي سَعِيدٍ الْخُدْرِيِّ، عَنْ أَبِي مُوسَى الأَشْعَرِيِّ، أَنَّهُ قَالَ قَالَ رَسُولُ اللَّهِ ﷺ " الاِسْتِئْذَانُ ثَلاَثٌ فَإِنْ أُذِنَ لَكَ فَادْخُلْ وَإِلاَّ فَارْجِعْ " .