Abdullah bin Umar reported,

The Messenger of Allah ﷺ entered the Kaabah accompanied by Usama bin Zayd, Bilal, and Uthman bin Talha al-Hajabi. He shut the door behind him and remained inside for a while.When Bilal came out, I asked him, "What did the Prophet ﷺ do inside?"He replied, "He placed one pillar on his left, one pillar on his right, and three pillars behind him. The House at that time stood on six pillars. Then he prayed."Ismail said to us, Malik narrated to me, and he said, "Two pillars on his right."

Bukhari 505

Sahih

حدثنا عبد الله بن يوسف قال أخبرنا مالك عن نافع

عن عبد الله بن عمر

أن رسول الله ﷺ دخل الكعبة وأسامة بن زيد وبلال وعثمان بن طلحة الحجبي فأغلقها عليه ومكث فيها فسألت بلالا حين خرج ما صنع النبي ﷺ قال جعل عمودا عن يساره وعمودا عن يمينه وثلاثة أعمدة وراءه وكان البيت يومئذ على ستة أعمدة ثم صلى وقال لنا إسماعيل حدثني مالك وقال عمودين عن يمينه

البخاري 505صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Prayer
Chapter
Prayer between the pillars when not in congregation
Numbering
Darussalam 505
Bukhari 505