The essence of prayer in a minyan is praying Shemoneh Esrei together with ten Jews. One who does not succeed in praying Shemoneh Esrei together with the congregation should pray with the chazan when he repeats the Amidah (Chazarat HaShatz) since, according to most poskim, that is also regarded as prayer recited in a minyan.
Additionally, if a person arrives late to synagogue and recites the Amidah while the congregation is still reciting other parts of the prayer service, such as Aleinu Leshabe’ach, although he is not considered praying in a minyan, he does derive some merit, since he is praying in a holy place where ten Jews are singing songs of praise. If he recites the Amidah of Shacharit while the congregation is praying Musaf, he is considered to be praying in a minyan (Tzelach, Berachot 6a; Mishnah Berurah 90:30).
A person who is unable to attend synagogue should try to coordinate the time he prays with the time the congregation prays, thereby partially engaging himself in the minyan’s prayer. This way, his prayer will be accepted, since the time the congregation prays is a favorable time (Berachot 8a; Shulchan Aruch 90:9). Lechatchilah, he should try to synchronize his prayer with the prayers of a specific congregation whose schedule he knows. If he does not know when a particular congregation is praying, he should have in mind to pray with any minyan, for surely any time he prays there is a minyan somewhere in the world that is standing in prayer.
Further, it is implied from the Mishnah Berurah 66:35 that the essence of prayer in a minyan is that one begins to recite the Amidah together with the congregation. However, most poskim write that even if a person is a few berachot ahead or behind, he is still considered to be praying in a minyan, as written in Yabia Omer, part 2, 7, based on the Pri Chadash and others. The Acharonim also disagree concerning whether or not the prayer of six people praying together with four who already prayed is considered prayer in a minyan. Yechaveh Da’at 5:7 considers it to be prayer in a minyan, whereas, Igrot Moshe, Orach Chaim, part 1, 28, writes that it is not considered prayer in a minyan, yet they are permitted to recite matters of sanctity. In conclusion, there are different levels regarding the status of prayer in a minyan.