Abu Saeed Khudri reported,

The Messenger of Allah ﷺ said, "When one of you is uncertain about his prayer and does not know how much he has prayed, let him build upon what he is certain of, and once he is sure he has completed the prayer, let him perform two prostrations before giving the salam. For if his prayer was an odd number, these will make it even, and if it was already even, they will be a humiliation for Satan."

Ahmad 11689

Sahih

حدثنا يونس بن محمد حدثنا فليح عن زيد بن أسلم عن عطاء بن يسار

عن أبي سعيد الخدري

أن رسول الله ﷺ قال إذا شك أحدكم في صلاته فلم يدر كم صلى فليبن على اليقين حتى إذا استيقن أن قد أتم فليسجد سجدتين قبل أن يسلم فإنه إن كانت صلاته وترا صارت شفعا وإن كانت شفعا كان ذلك ترغيما للشيطان

أحمد 11689صحيح
Contents
Reference
Commentary
Ayat
Collection
Musnad Ahmad
Book
Abu Saeed Khudri
Numbering
Darussalam 11689
Ahmad 11689