The Messenger of Allah ﷺ said, "Do not set out on a journey except to three mosques, the Sacred Mosque, this mosque of mine, and the Aqsa Mosque."
أخبرنا محمد بن منصور قال حدثنا سفيان عن الزهري عن سعيد
عن رسول الله ﷺ قال لا تشد الرحال إلا إلى ثلاثة مساجد مسجد الحرام ومسجدي هذا ومسجد الأقصى
Bukhari narrated it in "The Merit of Prayer in the Masjid of Makkah and Madinah," the chapter "The Merit of Prayer in the Masjid of Makkah and Madinah," hadith no. 1189, and Muslim narrated it in "Hajj," the chapter "The Merit of the Three Masjids," hadith no. 1397, from the hadith of Sufyan bin Uyayna, through the same chain. It is also found in Kubra, hadith no. 779.