Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
suyuti:2572a

When you offer the prayer, and you are in doubt about the number of rak'ahs whether offered three or four, and you have prayed four rak'ahs in all probability in your opinion, you should recite tashahhud and make two prostrations while you are sitting before giving the salutation. afterwards you should recite the tashahhud and give the salutation again. Abu Dawud said: This tradition has been narrated by 'Abd al-Wahid from Khusaif, but he did not report it as a statement of the Prophet ﷺ. The version of 'Abd al-Wahid has been corroborated by Sufyan, Sharik, and Isra'il. They differed amongst themselves about the text of the tradition and they did not narrate it with the continuous chain up to the Prophet ﷺ. (Using translation from Abū Dāʾūd 1028)   

السيوطي:٢٥٧٢a

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

[د] أبو داود [ق] البيهقى في السنن عن ابن مسعود

See similar narrations below:

Collected by Abū Dāwūd, Aḥmad, Nasāʾī's Kubrá, Bayhaqī
abudawud:1028al-Nufaylī > Muḥammad b. Salamah > Khuṣayf > Abū ʿUbaydah b. ʿAbdullāh from his father

When you offer the prayer, and you are in doubt about the number of rak'ahs whether offered three or four, and you have prayed four rak'ahs in all probability in your opinion, you should recite tashahhud and make two prostrations while you are sitting before giving the salutation. afterwards you should recite the tashahhud and give the salutation again. Abu Dawud said: This tradition has been narrated by 'Abd al-Wahid from Khusaif, but he did not report it as a statement of the Prophet ﷺ. The version of 'Abd al-Wahid has been corroborated by Sufyan, Sharik, and Isra'il. They differed amongst themselves about the text of the tradition and they did not narrate it with the continuous chain up to the Prophet ﷺ.  

أبو داود:١٠٢٨حَدَّثَنَا النُّفَيْلِيُّ حَدَّثَنَا مُحَمَّدُ بْنُ سَلَمَةَ عَنْ خُصَيْفٍ عَنْ أَبِي عُبَيْدَةَ بْنِ عَبْدِ اللَّهِ عَنْ أَبِيهِ

عَنْ رَسُولِ اللَّهِ ﷺ قَالَ إِذَا كُنْتَ فِي صَلاَةٍ فَشَكَكْتَ فِي ثَلاَثٍ أَوْ أَرْبَعٍ وَأَكْبَرُ ظَنِّكَ عَلَى أَرْبَعٍ تَشَهَّدْتَ ثُمَّ سَجَدْتَ سَجْدَتَيْنِ وَأَنْتَ جَالِسٌ قَبْلَ أَنْ تُسَلِّمَ ثُمَّ تَشَهَّدْتَ أَيْضًا ثُمَّ تُسَلِّمُ  

قَالَ أَبُو دَاوُدَ رَوَاهُ عَبْدُ الْوَاحِدِ عَنْ خُصَيْفٍ وَلَمْ يَرْفَعْهُ وَوَافَقَ عَبْدَ الْوَاحِدِ أَيْضًا سُفْيَانُ وَشَرِيكٌ وَإِسْرَائِيلُ وَاخْتَلَفُوا فِي الْكَلاَمِ فِي مَتْنِ الْحَدِيثِ وَلَمْ يُسْنِدُوهُ
ahmad:4075Muḥammad b. Salamah > Khuṣayf > Abū ʿUbaydah > Abīh ʿAbdullāh b. Masʿūd

[Machine] From the Prophet ﷺ: He said, "If you are in prayer and you have doubts in three or four or more, then your doubt is on four, then you should make the Tashahhud, then prostrate two prostrations while you are in a sitting position before you make the Salam, then make the Tashahhud again, then make the Salam."  

أحمد:٤٠٧٥حَدَّثَنَا مُحَمَّدُ بْنُ سَلَمَةَ عَنْ خُصَيْفٍ عَنْ أَبِي عُبَيْدَةَ عَنْ أَبِيهِ عَبْدِ اللهِ بْنِ مَسْعُودٍ

عَنِ النَّبِيِّ ﷺ قَالَ إِذَا كُنْتَ فِي الصَّلَاةِ فَشَكَكْتَ فِي ثَلَاثٍ وَأَرْبَعٍ وَأَكْثَرُ ظَنِّكَ عَلَى أَرْبَعٍ تَشَهَّدْتَ ثُمَّ سَجَدْتَ سَجْدَتَيْنِ وَأَنْتَ جَالِسٌ قَبْلَ أَنْ تُسَلِّمَ ثُمَّ تَشَهَّدْتَ أَيْضًا ثُمَّ سَلَّمْتَ  

nasai-kubra:608ʿAmr b. Hishām > Muḥammad b. Salamah > Khuṣayf > Abū ʿUbaydah from his father

When you offer the prayer, and you are in doubt about the number of rak'ahs whether offered three or four, and you have prayed four rak'ahs in all probability in your opinion, you should recite tashahhud and make two prostrations while you are sitting before giving the salutation. afterwards you should recite the tashahhud and give the salutation again. Abu Dawud said: This tradition has been narrated by 'Abd al-Wahid from Khusaif, but he did not report it as a statement of the Prophet ﷺ. The version of 'Abd al-Wahid has been corroborated by Sufyan, Sharik, and Isra'il. They differed amongst themselves about the text of the tradition and they did not narrate it with the continuous chain up to the Prophet ﷺ. (Using translation from Abū Dāʾūd 1028)   

الكبرى للنسائي:٦٠٨أَخْبَرَنِي عَمْرُو بْنُ هِشَامٍ قَالَ حَدَّثَنَا مُحَمَّدُ بْنُ سَلَمَةَ عَنْ خُصَيْفٍ عَنْ أَبِي عُبَيْدَةَ عَنْ أَبِيهِ

عَنِ النَّبِيِّ ﷺ قَالَ «إِذَا كُنْتَ فِي صَلَاةِ فَشَكَكْتَ فِي ثَلَاثٍ وَأَرْبَعٍ وَأَكْثَرُ ظَنِّكَ عَلَى أَرْبَعٍ تَشَهَّدْتَ ثُمَّ سَجَدْتَ قَبْلَ أَنْ تُسَلِّمَ ثُمَّ تَشَهَّدْتَ أَيْضًا ثُمَّ سَلِّمْ»  

bayhaqi:3901my father

When you offer the prayer, and you are in doubt about the number of rak'ahs whether offered three or four, and you have prayed four rak'ahs in all probability in your opinion, you should recite tashahhud and make two prostrations while you are sitting before giving the salutation. afterwards you should recite the tashahhud and give the salutation again. Abu Dawud said: This tradition has been narrated by 'Abd al-Wahid from Khusaif, but he did not report it as a statement of the Prophet ﷺ. The version of 'Abd al-Wahid has been corroborated by Sufyan, Sharik, and Isra'il. They differed amongst themselves about the text of the tradition and they did not narrate it with the continuous chain up to the Prophet ﷺ. (Using translation from Abū Dāʾūd 1028)   

البيهقي:٣٩٠١أَخْبَرَنَا أَبُو الْفَضْلِ بْنُ أَبِي سَعِيدٍ الْهَرَوِيُّ قَدِمَ عَلَيْنَا حَاجًّا أنبأ أَبُو عَبْدِ الرَّحْمَنِ عَبْدُ اللهِ بْنُ عُمَرَ بْنِ أَحْمَدَ بْنِ عَلِيٍّ الْجَوْهَرِيُّ بِمَرْوَ ثنا مُحَمَّدُ بْنُ إِبْرَاهِيمَ الْبُوشَنْجِيُّ ثنا النُّفَيْلِيُّ ثنا مُحَمَّدُ بْنُ سَلَمَةَ عَنْ خُصَيْفٍ عَنْ أَبِي عُبَيْدَةَ عَنْ عَبْدِ اللهِ بْنِ مَسْعُودٍ ؓ

أَنَّ رَسُولَ اللهِ ﷺ قَالَ إِذَا كُنْتَ فِي الصَّلَاةِ فَشَكَكْتَ فِي ثَلَاثٍ أَوْ أَرْبَعٍ وَأَكْثَرَ أَظُنُّكَ عَلَى أَرْبَعٍ تَشَهَّدْتَ ثُمَّ سَجَدْتَ سَجْدَتَيْنِ وَأَنْتَ جَالِسٌ قَبْلَ أَنْ تُسَلِّمَ ثُمَّ تَشَهَّدْتَ أَيْضًا ثُمَّ سَلَّمْتَ وَهَذَا غَيْرُ قَوِيٍّ وَمُخْتَلَفٌ فِي رَفَعِهِ وَمَتْنِهِ  

bayhaqi:3820Abū ʿAlī al-Rūdhbārī > Abū Bakr b. Dāsah > Abū Dāwud > al-Nufaylī > Muḥammad b. Salamah > Khuṣayf > Abū ʿUbaydah b. ʿAbdullāh from his father

[Machine] The translator of this passage is uncertain about the exact meaning and is unable to provide an English translation.  

البيهقي:٣٨٢٠أَخْبَرَنَاهُ أَبُو عَلِيٍّ الرُّوذْبَارِيُّ أنبأ أَبُو بَكْرِ بْنُ دَاسَةَ ثنا أَبُو دَاوُدَ ثنا النُّفَيْلِيُّ ثنا مُحَمَّدُ بْنُ سَلَمَةَ عَنْ خُصَيْفٍ عَنْ أَبِي عُبَيْدَةَ بْنِ عَبْدِ اللهِ عَنْ أَبِيهِ

عَنْ رَسُولِ اللهِ ﷺ إِذَا كُنْتَ فِي صَلَاةٍ فَشَكَكْتَ فِي ثَلَاثٍ أَوْ أَرْبَعٍ وَأَكْثَرُ ظَنِّكَ عَلَى أَرْبَعٍ تَشَهَّدْتَ ثُمَّ سَجَدْتَ سَجْدَتَيْنِ وَأَنْتَ جَالِسٌ قَبْلَ أَنْ تُسَلِّمَ ثُمَّ تَشَهَّدْتَ أَيْضًا ثُمَّ تُسَلِّمَ قَالَ أَبُو دَاوُدَ وَكَذَا  

رَوَاهُ عَبْدُ الْوَاحِدِ عَنْ خُصَيْفٍ وَلَمْ يَرْفَعْهُ وَوَافَقَ عَبْدَ الْوَاحِدِ أَيْضًا سُفْيَانُ وَشَرِيكٌ وَإِسْرَائِيلُ وَاخْتَلَفُوا فِي الْكَلَامِ فِي مَتْنِ الْحَدِيثِ وَلَمْ يُسْنِدُوهُ