It wasnarrated that 'Abdullah said:
"The Messenger of Allah (ﷺ)said:'If anyone of you is uncertain about his prayer, let him try todowhat is correct then let him prostrate twice.'"Tanafisi said: "This is the basic rule, and no one is able to reject it." (JA)
English reference (JA): Vol. 1, Book 5, Hadith 1212 (JA)
Arabic reference (JA): Book 5, Hadith 1269 (JA)