I said to Abu Saeed, "One of us prays and does not know how he prayed."He replied, "The Messenger of Allah ﷺ said, 'When one of you prays and does not know how he prayed, let him perform two prostrations while sitting.'"
حدثنا أحمد بن منيع حدثنا إسمعيل بن إبراهيم حدثنا هشام الدستوائي عن يحيى بن أبي كثير
قلت لأبي سعيد أحدنا يصلي فلا يدري كيف صلى فقال قال رسول الله ﷺ إذا صلى أحدكم فلم يدر كيف صلى فليسجد سجدتين وهو جالس
Source, [Its chain is hasan]. Abu Dawud narrated it in the Book of Prayer, chapter on one who says he should complete his prayer based on his best judgment, hadith no. 1029, and Ibn Majah also narrated it, hadith no. 1204, both from the hadith of Ismail bin Ulaya, with the same wording. Ibn Khuzayma graded it sahih, hadith no. 29, and Hakim judged it as meeting the standard of the two sheikhs (Bukhari and Muslim), 1/324, and Dhahabi agreed with him.On this subject there are also narrations from Uthman [Ahmad, 1/63], Ibn Masud [mentioned earlier, 392], Ayesha [Bayhaqi in Sunan al-Kubra, 2/346], and Abu Hurairah [coming up, 397]. The hadith, "If one of you is in doubt about the one," etc., will come at 398.