Ata reported,

Ati said, I heard Ibn Abbas say, "You have only been commanded to perform the circumambulation, you have not been commanded to enter it." He said, he did not forbid entering it, but I heard him say, "Usama bin Zayd informed me that when the Prophet ﷺ entered the House, he supplicated in all of its sides and did not pray inside it until he came out. When he came out, he prayed two rakahs facing the House and said, 'This is the qiblah.'"I asked him, "Do you mean its sides? Or in its corners?"He replied, "Rather, facing every side of the House."

Azami 5309

Sahih

عن عطاء، قال

سمعت ابن عباس يقول: إنما أمرتم بالطواف، ولم تؤمروا بدخوله قال: لم يكن ينهى عن دخوله، ولكني سمعته يقول: أخبرني أسامة بن زيد أن النبي ﷺ لما دخل البيت دعا في نواحيه كلها، ولم يصل فيه حتى خرج، فلما خرج ركع في قبل البيت ركعتين، وقال: هذه القبلة. قلت له: ما نواحيها؟ أو في زواياها؟ قال: بل في كل قبلة من البيت.

الأعظمي 5309صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Hajj
Chapter
Description of the Hajj of the Prophet ﷺ as narrated by Jabir and others, and the rulings mentioned therein
Section
Those who said the Prophet ﷺ did not pray in the Kaaba
Numbering
Jami al-Kamil 5309 (2nd edition)
Azami 5309