Abdullah bin Masud reported,

The Messenger of Allah ﷺ said, "If you are praying and you become uncertain whether you have prayed three or four units, but your stronger assumption is that you have prayed four, then recite the tashahhud, then perform two prostrations while seated before you give the salam, then recite the tashahhud again, then give the salam."

Abu Dawud 1028

Daif

حدثنا النفيلي حدثنا محمد بن سلمة عن خصيف

عن أبي عبيدة بن عبد الله عن أبيه

عن رسول الله ﷺ قال إذا كنت في صلاة فشككت في ثلاث أو أربع وأكبر ظنك على أربع تشهدت ثم سجدت سجدتين وأنت جالس قبل أن تسلم ثم تشهدت أيضا ثم تسلم

أبو داود 1028ضعيف
Contents
Reference
Commentary
Ayat
Collection
Sunan Abu Dawud
Book
Prayer
Chapter
Whoever says one should complete the prayer based on their predominant assumption
Numbering
Darussalam 1028
Abu Dawud 1028