Before answering, check these 5 points:
● Does the sentence begin with a past verb?
● Is the doer pronominal or an explicit noun?
● If explicit, does it come after the verb?
● Is the visible subject nominative?
● In this level's exercises, did you use masculine-singular before a masculine subject and feminine-singular before a feminine subject?
Do not be misled by a plural noun: الْمُسْلِمُونَ is plural, but in سَجَدَ الْمُسْلِمُونَ the preceding verb remains masculine singular.