The Prophet ﷺ said, "Do not undertake a journey except to three mosques, the Sacred Mosque, the Mosque of the Messenger ﷺ, and the Aqsa Mosque."
عن النبي ﷺ قال: لا تشد الرحال إلا إلى ثلاثة مساجد: المسجد الحرام، ومسجد الرسول ﷺ، والمسجد الأقصى.
Bukhari narrated it in the chapter on the merit of prayer in the masjid of Makkah and Madinah (1189), and Muslim in the Hajj chapter (511:1397), both of them via Sufyan, from Zuhri, from Saeed, from Abu Hurairah, who said, and then he mentioned it.