The Messenger of Allah ﷺ entered the Kaabah along with Usama bin Zayd, Uthman bin Talha al-Hajabi, and Bilal. He had the door closed behind him and remained inside for a while.Abdullah bin Umar said, "When Bilal came out, I asked him what the Messenger of Allah ﷺ had done 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."
حدثنا القعنبي عن مالك عن نافع
أن رسول الله ﷺ دخل الكعبة هو وأسامة بن زيد وعثمان بن طلحة الحجبي وبلال فأغلقها عليه فمكث فيها قال عبد الله بن عمر فسألت بلالا حين خرج ماذا صنع رسول الله ﷺ فقال جعل عمودا عن يساره وعمودين عن يمينه وثلاثة أعمدة وراءه وكان البيت يومئذ على ستة أعمدة ثم صلى
Bukhari narrated it in the Book of Salah, chapter "Prayer between the Pillars Without a Congregation," Hadith: 505 etc., Hadith: 1329, from the hadith of Malik, and Muslim narrated it in the Book of Hajj, chapter "The Recommendation of Entering the Kaaba for the Pilgrim and Others," through the same route, and it is in Muwatta (Yahya): 1/398.