Man Lā Yaḥḍuruh al-Faqīh
Hadith 10111015 - وَ رَوَى اَلْحَلَبِيُّ عَنْ أَبِي عَبْدِ اَللَّهِ عَلَيْهِ اَلسَّلاَمُ أَنَّهُ قَالَ: «إِذَا لَمْ تَدْرِ أَ ثِنْتَيْنِ صَلَّيْتَ أَمْ أَرْبَعاً وَ لَمْ يَذْهَبْ وَهْمُكَ إِلَى شَيْءٍ فَتَشَهَّدْ وَ سَلِّمْ ثُمَّ صَلِّ رَكْعَتَيْنِ وَ أَرْبَعَ سَجَدَاتٍ تَقْرَأُ فِيهِمَا بِأُمِّ اَلْكِتَابِ ثُمَّ تَشَهَّدُ وَ تُسَلِّمُ فَإِنْ كُنْتَ إِنَّمَا صَلَّيْتَ رَكْعَتَيْنِ كَانَتَا هَاتَانِ تَمَامَ اَلْأَرْبَعِ وَ إِنْ كُنْتَ صَلَّيْتَ أَرْبَعاً كَانَتَا هَاتَانِ نَافِلَةً.
Hadith.1015 - Al-Halabi narrated from Imam Jafar ibn Muhammad Al-Sadiq (as) that He said:
"If you do not know whether you prayed two rak'ahs or four, and your doubt does not lead you to any conclusion, then perform the tashahhud and give the salaam, then pray two more rak'ahs with four prostrations. In them, recite Al-Fatiha.
Afterward, perform the tashahhud and give the salaam. If you had prayed only two rak'ahs, then these will complete the four. But if you had prayed four, then these two will be considered as voluntary (nawafil)."