I prayed behind an Imam and when he prostrated in one of the rak’ats he immediately stood up and did not sit between the two prostrations, in addition to that he did not observe the second prostration, when it was said to him subhanallah after he had stood up, he carried on with prayer without observing the second prostration that he had forgotten but he however made sajdah sahw (prostration for omission). Is our prayer valid?
تركنا سجدة فهل صلاتنا صحيحة