Question: Someone was praying behind in a group and was absent minded so the leader of the prayer preceded him by one or more obligations. What should he do?
Answer: If he fell behind more than two obligations in a subset (rakaah) then he must make this subset up after the leader finishes. For example, if he was standing until the leader lifted his head from the first prostration in a subset, then he has falled behind by a bow and a prostration, which are 2 obligations; he should skip to where the leader is and make up this subset after the leader finishes the prayer. If he bowed before the leader lifted his head, then he has fallen behind by only 1 obligation and should continue normally.
Note that one should make an effort to stay right behind the leader in prayer; if he bows, one should immediately bow; if he prostrates, one should immediately prostrate. One should not even wait for the leader to say "Allahu akbar" before following his movements, because this saying is a sunnah, and it is more important to follow the leader in obligations.