"When one of you becomes forgetful in his Salat so that he does not know if he prayed one or two, then let him consider it one. When he does not know if he prayed three or four, then let him consider it three, and let him perform two prostrations before he says the Taslim."
سَمِعْتُ النَّبِيَّ ﷺ يَقُولُ إِذَا سَهَا أَحَدُكُمْ فِي صَلاَتِهِ فَلَمْ يَدْرِ وَاحِدَةً صَلَّى أَوْ ثِنْتَيْنِ فَلْيَبْنِ عَلَى وَاحِدَةٍ فَإِنْ لَمْ يَدْرِ ثِنْتَيْنِ صَلَّى أَوْ ثَلاَثًا فَلْيَبْنِ عَلَى ثِنْتَيْنِ فَإِنْ لَمْ يَدْرِ ثَلاَثًا صَلَّى أَوْ أَرْبَعًا فَلْيَبْنِ عَلَى ثَلاَثٍ وَلْيَسْجُدْ سَجْدَتَيْنِ قَبْلَ أَنْ يُسَلِّمَ