The Messenger of Allah ﷺ entered the Kaabah along with Usama bin Zayd, Bilal, and Uthman bin Talha al-Hajabi, and the door was shut behind them.Abdullah bin Umar said, "When Bilal came out, I asked him, 'What did the Messenger of Allah ﷺ do inside?'"Bilal replied, "He placed one pillar on his left, two pillars on his right, and three pillars behind him. The House at that time stood on six pillars. Then he prayed, leaving about three cubits between himself and the wall."
أخبرنا محمد بن سلمة والحارث بن مسكين قراءة عليه وأنا أسمع عن ابن القاسم قال حدثني مالك عن نافع
أن رسول الله ﷺ دخل الكعبة هو وأسامة بن زيد وبلال وعثمان بن طلحة الحجبي فأغلقها عليه قال عبد الله بن عمر فسألت بلالا حين خرج ماذا صنع رسول الله ﷺ قال جعل عمودا عن يساره وعمودين عن يمينه وثلاثة أعمدة وراءه وكان البيت يومئذ على ستة أعمدة ثم صلى وجعل بينه وبين الجدار نحوا من ثلاثة أذرع
Bukhari narrated it in the Book of Prayer, chapter on prayer between the pillars without a congregation, hadith no. 505, and Muslim in the Book of Hajj, chapter on the recommendation of entering the Kaaba for the pilgrim and others... etc., hadith no. 1329, from the hadith of Malik through this chain. It is also found in Muwatta (Yahya) 1/398, and in Kubra, hadith no. 825.