Usama bin Zayd reported,

The Prophet ﷺ, when he entered the House, made supplication in all of its corners and did not pray inside it until he came out. Once he came out, he prayed two rakahs facing the House and said, "This is the qiblah."

Azami 1931

Sahih

عن أسامة بن زيد

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

الأعظمي 1931صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Prayer
Chapter
Description of prayer, the takbir, standing, and recitation
Section
Obligation of facing the qibla
Numbering
Jami al-Kamil 1931 (2nd edition)