The Messenger of Allah ﷺ said, "Do not set out on a journey except to three mosques, this mosque of mine, the Sacred Mosque, and the Aqsa Mosque."
قال رسول الله ﷺ: لا تشدوا الرحال إلا إلى ثلاثة مساجد: مسجدي هذا، والمسجد الحرام، والمسجد الأقصى.
Bukhari narrated it in the Book of the Merit of Prayer in the Masjid of Makkah and Madinah (1197), and Muslim in the Book of Hajj (827/415), both from the hadith of Abdul-Malik bin Umayr, from Qazaa, from Abu Saeed, who related the hadith, and the wording given is that of Muslim. There are other hadiths on this subject mentioned in the chapters on masjids.