مُسْنَدُ أَحْمَدَ
Musnad Ahmad 2968
Musnad of 'Abdullah bin al-'Abbas bin 'Abdul-Muttalib from the Prophet
It was narrated that Ibn ‘Abbas (رضي الله عنه) said: When he was in Makkah, the Messenger of Allah (ﷺ) used to pray facing Jerusalem, with the Ka'bah in front of him, (and he used to pray facing Jerusalem) for sixteen months after he migrated to Madinah, then he was told to change (the qiblah) to the Ka'bah.
Musnad Ahmad 2991lts isnad is saheeh)