Hadithcore
Sahih al-Bukhari, 3088
sahih

Narrated Ka`b:

Whenever the Prophet (ﷺ) returned from a journey in the forenoon, he would enter the Mosque and offer two rak`at before sitting.

حَدَّثَنَا أَبُو عَاصِمٍ، عَنِ ابْنِ جُرَيْجٍ، عَنِ ابْنِ شِهَابٍ، عَنْ عَبْدِ الرَّحْمَنِ بْنِ عَبْدِ اللَّهِ بْنِ كَعْبٍ، عَنْ أَبِيهِ، وَعَمِّهِ، عُبَيْدِ اللَّهِ بْنِ كَعْبٍ عَنْ كَعْبٍ ـ رضى الله عنه ـ أَنَّ النَّبِيَّ صلى الله عليه وسلم كَانَ إِذَا قَدِمَ مِنْ سَفَرٍ ضُحًى دَخَلَ الْمَسْجِدَ، فَصَلَّى رَكْعَتَيْنِ قَبْلَ أَنْ يَجْلِسَ‏.‏

References2 variants
In-Book Reference
Book 56, Hadith 292
USC-MSA web (English) reference
Vol. 4, Book 52, Hadith 321 (deprecated numbering scheme)
Sharh · explanationclick to expand
The Prophet ﷺ was an excellentmentor and educator; he ﷺ taught us the Islamic etiquette of travelling and returning back, what a traveler should do when he returns back to his family, and the activity that should be done first. In this hadeeth, Ka‘b ibn Maalik (may Allah be pleased with him) stated that whenever the Prophetﷺreturned from a journey, for Jihaad or Hajj purposes, or otherwise, in the forenoon, he ﷺ would enter the mosque and offer two Rak‘ahs before sitting down. Another version of the hadeeth recorded in Saheeh Muslim reads: “The Prophet ﷺ always came back from a journey at daytime in the forenoon.” Upon arriving back to Al-Madeenah, he ﷺ would go first to the mosque to perform two Rak’ahs, to express gratitude to Allah, Exalted is He, for his safe return, before he ﷺ would sit down with people,so they could greet him and welcome him back..