Sunan Ibn Majah – Hadith No : 1266

It wasnarrated that ‘Abdur-Rahman bin ‘Awf said: “I heard theMessenger of Allah (ﷺ) say: ‘If anyone of you is uncertain as towhether he has prayed one or two Rak’ah, let him assume it is one.Ifhe is uncertain as to whether he has prayed two or three, let himassume it is two. If he is uncertain as to whether he has prayedthreeor four, let him assume it is three. Then let him complete whatisleft of his prayer, so that the doubt will be about what is more.Thenlet him prostrate twice while he is sitting, before the Taslim(sayingthe Salam).’”

Hadith In Arabic Text :

حدثنا أبو يوسف الرقي، محمد بن أحمد الصيدلاني حدثنا محمد بن سلمة، عن محمد بن إسحاق، عن مكحول، عن كريب، عن ابن عباس، عن عبد الرحمن بن عوف، قال سمعت رسول الله صلى الله عليه وسلم يقول ‏”‏ إذا شك أحدكم في الثنتين والواحدة فليجعلها واحدة وإذا شك في الثنتين والثلاث فليجعلها ثنتين وإذا شك في الثلاث والأربع فليجعلها ثلاثا ثم ليتم ما بقي من صلاته حتى يكون الوهم في الزيادة ثم يسجد سجدتين وهو جالس قبل أن يسلم ‏”‏ ‏.‏

Chapter : Establishing the Prayer and the Sunnah Regarding Them – كتاب إقامة الصلاة والسنة فيها