My father (may Allah سبحانه وتعالى be pleased with him) said in his letter to me: "Do not pray behind anyone except for one of two types of people: either someone whose religion and piety you trust, or someone you must pray behind out of fear of their power, sword, or harshness towards the religion. Pray behind them as a form of precaution and accommodation, and in this case, you may make your own intention and recite for yourself without following them as an Imam. If you finish reciting a surah before them, leave one verse and continue praising Allah سبحانه وتعالى until the Imam bows, at which point you should finish the verse and bow. If you are performing a supererogatory (nafl) prayer and the congregational prayer is established, stop and join the obligatory prayer. If you are in an obligatory prayer, do not stop it; instead, make it a supererogatory prayer, complete it with two units, and then join the Imam. However, if the Imam is one you fear, do not interrupt your prayer or make it a supererogatory prayer; simply continue, move to the row, and pray alongside the congregation. When the Imam stands for the fourth unit, stand with him, recite the tashahhud from a standing position, and conclude the prayer."
Commentary #6