Sometimes, I go to pray in major mosques, such as Al-Azhar Mosque. I find two groups performing congregational prayers; one of them is at the front of the mosque and the other one is at the back. At that moment, I get confused. Should I pray individually, or choose one of the two groups to join?
The basic principle is that Congregational Prayer is meant to achieve unity and uniting the word of Muslims. Therefore, the existence of two group prayers in one mosque contradicts such principle.
If the Imam of the second congregation knows about the existence of the first one, then it is disliked for him to establish a second congregation, and he must join the first one.
If the questioner enters the mosque and finds two congregations at the same time, especially in major mosques, in which the one who is at the back may not see what is at the front, then performing the prayer in either of the two congregations is valid; whichever you joined, it is valid. Surely, it is better than praying alone.