All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger.
The Sunnah is that the Imaam stands in front of the people who stand behind him to pray. People, two or more, would stand behind him because when the Prophet used to stand for the prayer, the Companions used to stand behind him. Imaam Muslim reported that Jaabir and Jabbaar stood beside the Prophet one to his right side and one to his left side, so he took them by hand and pulled them back behind him.
Therefore, if the mosque is spacious enough to hold the prayer in congregation in this manner, then the Sunnah is that the Imaam would stand in front of the people, otherwise people can stand by his sides, because his standing in front of the people is a Sunnah and not an obligation and the benefit of praying in congregation is greater than the benefit of the Imaam standing in front with the people praying behind him.
It is better, in this case, that the Imaam stands in the middle of the row so that the people praying to his right side and those to his left side will have the same opportunity of being close to the Imaam and could listen to him equally. Imaam Abu Daawood reported with a weak chain of narration that the Prophet said: “Place the Imaam in the middle.”
As regards whether the first row is the row behind the Imaam or the row in which the Imaam stands, then it appears, in this case, which is the case in which the prayer started while people stand beside the Imaam in the same row as his, that the first row is the row in which the Imaam stands. However, in case the Imaam started the prayer and the rows were behind him and then other people who came late did not find a place in the rows behind the Imaam and stood beside him, in such a case, the first row would be the one behind the Imaam and not the row in which the Imaam stood.
Allaah Knows best.