The Messenger of Allah ﷺ said, "Do not undertake a journey except to three mosques, the Sacred Mosque, this mosque of mine, and the Aqsa Mosque."
حدثنا ابن أبي عمر حدثنا سفيان بن عيينة عن عبد الملك بن عمير عن قزعة
قال رسول الله ﷺ لا تشد الرحال إلا إلى ثلاثة مساجد مسجد الحرام ومسجدي هذا ومسجد الأقصى
Agreed upon [by Bukhari and Muslim]. Bukhari related it in "The Virtue of Prayer in the Masjid of Makkah and Madinah," chapter "The Masjid of Bayt al-Maqdis," hadith 1197, and Muslim in "Hajj," chapter "A Woman Traveling with a Mahram for Hajj and Otherwise," hadith 827/415, "Hajj," from the hadith of Abdul-Malik bin Umayr, with this same chain.