The Book of Salah
كتاب الصلاة
Chapter 21: The Virtue Of Prayer In Congregation
"I heard the Messenger of Allah (ﷺ) say: 'No one will enter the Fire who prays before the sun rises and before it sets.'"
Chapter 22: Prescribing The Qiblah
"We prayed toward Bait Al-Maqdis (Jerusalem) with the Messenger of Allah (ﷺ) for sixteen or seventeen months - Safwan was not sure - then it was changed to the Qiblah."
"The Messenger of Allah (ﷺ) came to Al-Madinah and prayed toward Bait Al-Maqdis for sixteen months, then he was commanded to face towards the Ka'bah. A man who had prayed with the Prophet (ﷺ) passed by some of the Ansar and said: 'I bear witness that the Messenger of Allah (ﷺ) has been commanded to face towards the Ka'bah' so they turned to face the Ka'bah."
Chapter 23: Situations In Which It Is Permitted Not To Face The Qiblah
"The Messenger of Allah (ﷺ) used to pray voluntary prayers (Usabbih) while riding his mount, facing whatever direction it was facing, and he would pray Witr likewise, but he would not offer the prescribed prayers on it."
"The Messenger of Allah (ﷺ) used to pray while on his animal when he was coming back from Makkah to Madinah. Concerning this, the verse was revealed: So wherever you turn (yourselves or your faces) there is the Face of Allah.'" [1][1] Al-Baqarah 2:115.
"The Messenger of Allah (ﷺ) used to pray on his mount while on a journey, no matter what direction it was facing."Malik said: "Abdullah bin Dinar said: 'And Ibn 'Umar used to do likewise.'"
Chapter 24: Finding Out That One Was Wrong After Doing His Utmost (To Determine The Direction)
"While the people were in Quba', praying the Subh prayer, someone came to them and said that revelation had come to the Messenger of Allah (ﷺ) the night before, and he has been commanded to face the Ka'bah. So they turned around, and they has been facing toward Ash-Sham, but now they turned to face toward the Ka'bah."