The World Federation One Stop Fiqh

Ruling 1452

If a follower inadvertently raises his head and sees that the imam is in sajdah, then based on obligatory precaution, he must go back into sajdah. In the event that this happens in both sajdahs, then performing the two additional sajdahs, which constitute a rukn, does not invalidate the prayer.