The Messenger of Allah ﷺ entered the Kaabah, and as his exit drew near, I had something to attend to, so I went off and returned quickly, only to find the Messenger of Allah ﷺ coming out.I asked Bilal, "Did the Messenger of Allah ﷺ pray inside the Kaabah?"He replied, "Yes, two units of prayer between the two pillars."
أخبرنا عمرو بن علي قال حدثنا يحيى قال حدثنا السائب بن عمر قال حدثني ابن أبي مليكة أن
دخل رسول الله ﷺ الكعبة ودنا خروجه ووجدت شيئا فذهبت وجئت سريعا فوجدت رسول الله ﷺ خارجا فسألت بلالا أصلى رسول الله ﷺ في الكعبة قال نعم ركعتين بين الساريتين
[Its chain of transmission is sahih] Ahmad narrated it: 12/6, from Yahya bin Saeed Qattan, through him, and it is in Kubra, hadith no. 3890.