Answer
✅ Answer: Please pay attention to the following narrations:
1 عَنْ أَبِي ذَرٍّ قَالَ: دَخَلْتُ عَلَى رَسُولِ اللَّهِ وَ هُوَ فِي الْمَسْجِدِ جَالِسٌ فَقَالَ لِي يَا أَبَا ذَرٍّ إِنَّ لِلْمَسْجِدِ تَحِيَّةً قُلْتُ وَ مَا تَحِيَّتُهُ قَالَ رَكْعَتَانِ تَرْكَعُهُمَا فَقُلْتُ يَا رَسُولَ اللَّهِ- إِنَّكَ أَمَرْتَنِي بِالصَّلَاةِ فَمَا الصَّلَاةُ قَالَ خَيْرُ مَوْضُوعٍ فَمَنْ شَاءَ أَقَلَّ وَ مَنْ شَاءَ أَكْثَرَ
📚 Ma'ani al-Akhbar, p. 332
📚 Khisal, p. 523
Translation: Abu Dharr said: I entered upon the Messenger of Allah (peace be upon him and his family) while he was sitting in the mosque. He said to me: 'O Abu Dharr, indeed the mosque has a 'tahiyyah'.' I said: 'What is its 'tahiyyah'?' He said: 'Two rak'ahs of prayer that you perform.' I said: 'O Messenger of Allah (peace be upon him and his family), you have commanded me to pray. What is prayer?' He said: 'Prayer is the best subject (the best thing that has been established). So whoever wishes, let him pray a little, and whoever wishes, let him pray a lot.'
2 عَنْ عَبْدِ الرَّحْمَنِ بْنِ عُبَيْدٍ وَ غَيْرِهِ قَالُوا: لَمَّا دَخَلَ أَمِيرُ الْمُؤْمِنِينَ الْكُوفَةَ أَقْبَلَ حَتَّى دَخَلَ الْمَسْجِدَ فَصَلَّى رَكْعَتَيْنِ ثُمَّ صَعِدَ الْمِنْبَرَ
📚 Waq'at Siffin, p. 3
Translation: Abdul Rahman ibn Ubayd and others said: When Amir al-Mu'minin (peace be upon him) entered Kufa, they came until they entered the mosque. He then performed two rak'ahs of prayer and then ascended the pulpit.
3 عَنْ شُعَيْبِ بْنِ وَاقِدٍ عَنِ الْحُسَيْنِ بْنِ زَيْدٍ عَنِ الصَّادِقِ عَنْ آبَائِهِ فِي حَدِيثِ الْمَنَاهِي قَالَ: قَالَ رَسُولُ اللَّهِ لَا تَجْعَلُوا الْمَسَاجِدَ طُرُقاً حَتَّى تُصَلُّوا فِيهَا رَكْعَتَيْنِ
📚 Faqih, Vol. 4, p. 4
Translation: The Messenger of Allah (peace be upon him and his family) said in the hadith of prohibitions: 'Do not make mosques a path or a place of passage until you (unless you) perform two rak'ahs of prayer in them.'
✅ In Arabic, 'tahiyyah' means 'greeting', 'may he remain', 'long live', and so on. However, in the terminology of the Quran and narrations, it has different meanings in different contexts.
For example, in Shia narrations, the prostration of the angels to Adam (peace be upon our Prophet and his family and upon him) was for Allah, and at the same time, it was a 'tahiyyah' for Adam (peace be upon him). Likewise, the prostration of Joseph's brothers before Joseph was prostration to Allah, but it was performed as a 'tahiyyah' to Joseph (peace be upon him).
✅ According to Shia narrations, the 'tahiyyah' of a Muslim and a believer and the 'tahiyyah' of the people of paradise is 'greeting' with its specific formulas and manners.
✅ According to the first narration, which Abu Dharr (may Allah have mercy on him) narrated, performing two rak'ahs of prayer in the mosque is the 'tahiyyah of the mosque'. Also, in the third narration, the Messenger of Allah (peace be upon him and his family) forbade making mosques a place of passage without performing prayer in them. In general, what is forbidden is entering and passing through mosques without performing prayer in them. The 'tahiyyah of the mosque' is achieved and the prohibition is avoided regardless of what the prayer is called, whether it is a recommended or supererogatory prayer performed in the mosque, or a prescribed prayer. The first hadith shows that we should perform at least two rak'ahs of prayer upon entering the mosque and not leave the mosque without performing a prayer.