كتاب الصلاة
2  
Prayer (Kitab Al-Salat)
(348)
Chapter: Whoever Said The Doubt Should Be Ignored When One Is Confused Regarding (Whether He Has Prayed) Two Or Three Rak'ah
(199)
باب إِذَا شَكَّ فِي الثِّنْتَيْنِ وَالثَّلاَثِ مَنْ قَالَ يُلْقِي الشَّكَّ
Sunan Abi Dawud 1026

Narrated Ata' ibn Yasar:

The Prophet (ﷺ) said: When one of you is in doubt about his prayer, and does not know how much he has prayed, three or four rak'ahs, he should pray one (additional) rak'ah and make two prostrations while sitting before giving the salutation. If the (additional) rak'ah which he prayed is the fifth one, he will make it an even number by these two prostrations. If it is the fourth one, the two prostrations will be a disgrace for the devil.

حَدَّثَنَا الْقَعْنَبِيُّ، عَنْ مَالِكٍ، عَنْ زَيْدِ بْنِ أَسْلَمَ، عَنْ عَطَاءِ بْنِ يَسَارٍ، أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم قَالَ ‏ "‏ إِذَا شَكَّ أَحَدُكُمْ فِي صَلاَتِهِ فَلاَ يَدْرِي كَمْ صَلَّى ثَلاَثًا أَوْ أَرْبَعًا فَلْيُصَلِّ رَكْعَةً وَيَسْجُدْ سَجْدَتَيْنِ وَهُوَ جَالِسٌ قَبْلَ التَّسْلِيمِ فَإِنْ كَانَتِ الرَّكْعَةُ الَّتِي صَلَّى خَامِسَةً شَفَعَهَا بِهَاتَيْنِ وَإِنْ كَانَتْ رَابِعَةً فَالسَّجْدَتَانِ تَرْغِيمٌ لِلشَّيْطَانِ ‏"‏ ‏.‏
Grade: Sahih (Al-Albani)  صحيح   (الألباني) حكم   :
Reference : Sunan Abi Dawud 1026
In-book reference : Book 2, Hadith 637
English translation : Book 3, Hadith 1021