The Prophet ﷺ 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, The Merit of Prayer in the Masjid of Makkah and Madinah, chapter 1, no. 1189, and Muslim, Hajj, chapter on the Merit of the Three Masjids, no. 1397, from the hadith of Sufyan bin Uyayna, with this wording.