It was narrated from Abu Sa'eed that:The Prophet (ﷺ) said: "If one of you is not sure about his prayer, let him forget about what he is unsure of and complete his prayer on the basis of what he is sure of. When he is sure that he has completed it, let him prostrate twice while he is sitting. Then if he has prayed five (rak'ahs), they (the two prostrations) will make his prayer even-numbered, and if he had prayed four, they will annoy and humiliate the shaitan
Hadith No. 1238
Sunan an Nasai
Gradings:
Abu Ghuddah:
Hasan Sahih
Al-Albani:
Hasan Sahih
Zubair Ali Zai:
Sahih Muslim