When a person enters a Masjid for performing an obligatory Salat and finds another person praying can he join behind this person and take him as the Imam in leading the prayer?
Praise be to Allah, the Lord of the Worlds; and may His blessings and peace be upon our Prophet Muhammad and upon all his Family and Companions. No, he should stand next to the (person) Imam and he will get the reward for performing the prayer in congregation, Insha Allah. The follower should stand at the right hand side of the Imam if he is alone. If there is another person they join together and should make a row behind the Imam. Allah knows best.
You can search for fatwa through many choices