´Abu Qatadah narrated that :` Allah's Messenger said: "When one of you comes to the Masjid, then let him perform two Rak'ah before sitting."
Explanation & Benefits
Shaykh Dr. Abdur Rahman Freywai
1:
This is called Tahiyyat al-Masjid (the greeting of the mosque).
According to the majority, it is recommended (mustahabb), while according to the Shafi'is, it is obligatory (wajib).
The correct view is that it is highly emphasized, but it is not obligatory (fard).
2:
In the narration of Suhayl ibn Abi Salih, instead of "from Abu Qatadah," it is "from Jabir ibn Abdullah," and this is incorrect because other students of Amir ibn Abdullah have contradicted Suhayl.
Source: Sunan al-Tirmidhi – Majlis ‘Ilmi Dar al-Da‘wah, New Delhi Edition, Page: 316