Ati reported that the Messenger of Allah ﷺ performed umrah, circumambulated the House, and prayed two rakahs behind the Station, with someone shielding him from the people.A man asked him, "Did the Messenger of Allah ﷺ enter the Kaaba?"He replied, "No."
اعتمر رسول الله ﷺ فطاف بالبيت وصلى خلف المقام ركعتين، ومعه من يستره من الناس، فقال له رجل: أدخل رسول الله ﷺ لكعبة؟ قال: لا.
Bukhari narrated it in the Book of Hajj (1600), and Muslim in the Book of Hajj (1332), both through the route of Ismail bin Abu Khalid, from Abdullah bin Abu Awfa, who mentioned something similar. The wording given is that of Bukhari, and Muslim's wording is close to it.His statement, "he performed Umrah," refers to the year seven, the year of the reconciliation agreement. So there is no contradiction between the hadith of Ibn Umar and Ibn Abbas and the hadith of Abdullah bin Abu Awfa.Nawawi said, "The scholars said, the reason he did not enter ﷺ was the idols and images that were in the House. The polytheists would not leave it for him to remove them. So when Allah granted him victory over Makkah, he entered the House, prayed in it, and removed the images before entering it." End of quote."It is also possible that entering the House was not part of the agreement's condition, so had he wished to enter it they would have prevented him, just as they prevented him from staying in Makkah beyond three days. So he did not intend to enter it lest they prevent him." Ibn Hajar mentioned this in Fath al-Bari (3/468).