Abdullah bin Abbas reported,

When the Messenger of Allah ﷺ arrived, he refused to enter the House while the idols were still inside, so he ordered them to be removed. They brought out an image of Ibrahim and Ismail with divining arrows in their hands.The Messenger of Allah ﷺ said, "May Allah destroy them. By Allah, they knew very well that these two never cast lots with these arrows."Then he entered the House and pronounced the takbir in its corners, but did not pray inside it.

Azami 9196

Sahih

عن ابن عباس قال

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

الأعظمي 9196صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Biography of the Prophet ﷺ
Chapter
Events between the expedition of Mutah and the expedition of the conquest of Makkah
Section
Takbir in the corners of the House but not praying inside it
Numbering
Jami al-Kamil 9196 (2nd edition)