Abdullah bin Umar reported,

While the people were performing the dawn prayer at Quba, a man came to them and said, "The Messenger of Allah ﷺ has had Quran revealed to him last night, and he has been commanded to face the Kaabah, so face it."The people had been facing Sham, so they turned their faces toward the Kaabah.

Bukhari 4490

Sahih

حدثنا خالد بن مخلد حدثنا سليمان حدثني عبد الله بن دينار

عن ابن عمر رضي الله عنهما

بينما الناس في الصبح بقباء جاءهم رجل فقال إن رسول الله ﷺ قد أنزل عليه الليلة قرآن وأمر أن يستقبل الكعبة ألا فاستقبلوها وكان وجه الناس إلى الشأم فاستداروا بوجوههم إلى الكعبة

البخاري 4490صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Tafsir
Chapter
And if you brought to those who were given the Scripture every sign, they would not follow your qiblah" to His saying, "Then indeed, you would be among the wrongdoers
Numbering
Darussalam 4490
Bukhari 4490