Sunan Abi Dawud, Book 3, Hadith 1023 (USC-MSA) ⓘ
AbuUbaydah reported, on the authority of his father Abdullah (ibn Mas'ud), the Messenger of Allah as saying: 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.
حَدَّثَنَا النُّفَيْلِيُّ، حَدَّثَنَا مُحَمَّدُ بْنُ سَلَمَةَ، عَنْ خُصَيْفٍ، عَنْ أَبِي عُبَيْدَةَ بْنِ عَبْدِ اللَّهِ، عَنْ أَبِيهِ، عَنْ رَسُولِ اللَّهِ صلى الله عليه وسلم قَالَ " إِذَا كُنْتَ فِي صَلاَةٍ فَشَكَكْتَ فِي ثَلاَثٍ أَوْ أَرْبَعٍ وَأَكْبَرُ ظَنِّكَ عَلَى أَرْبَعٍ تَشَهَّدْتَ ثُمَّ سَجَدْتَ سَجْدَتَيْنِ وَأَنْتَ جَالِسٌ قَبْلَ أَنْ تُسَلِّمَ ثُمَّ تَشَهَّدْتَ أَيْضًا ثُمَّ تُسَلِّمُ " . قَالَ أَبُو دَاوُدَ رَوَاهُ عَبْدُ الْوَاحِدِ عَنْ خُصَيْفٍ وَلَمْ يَرْفَعْهُ وَوَافَقَ عَبْدَ الْوَاحِدِ أَيْضًا سُفْيَانُ وَشَرِيكٌ وَإِسْرَائِيلُ وَاخْتَلَفُوا فِي الْكَلاَمِ فِي مَتْنِ الْحَدِيثِ وَلَمْ يُسْنِدُوهُ .
also referenced under: Hadith 1028 (DarusSalam) & Hadith 1023 (Hasan)