In the case of a single follower, the follower will stand on the right side of the imam
Jabir (may Allah be pleased with him) narrates:
ثم جئت حتى قمت عن يسار رسول الله صلى الله عليه وسلم، فأخذ بيدي، فأدارني حتى أقامني عن يمينه، ثم جاء جبار بن صحر فتوضأ ، ثم جاء فقام عن يسار رسول الله صلى الله عليه وسلم، فأخذ رسول الله صلى الله عليه وسلم بيدينا جميعا، فدفعنا حتى أقامنا خلفه۔
“The Prophet ﷺ was in prayer. I too stood on the left side of the Prophet ﷺ. The Prophet ﷺ took hold of me by the hand during the prayer itself and, turning me around from behind, stood me on his right side. After that Jabbar ibn Sakhr (may Allah be pleased with him) came and stood on the left side of the Prophet ﷺ. The Prophet ﷺ took hold of both of us and put us in the row behind.”
If there are two or more followers, the imam will stand in front and the followers behind
Anas ibn Malik (may Allah be pleased with him) narrates:
صليت أنا ويتيم في بيتنا خلف النبي صلى الله عليه وسلم، وأتي ويتيم أم سليم خلفنا .
“I and a boy prayed in our house behind the Prophet ﷺ. My mother Umm Sulaym (may Allah be pleased with her) was standing behind us.”
Itban ibn Malik (may Allah be pleased with him) narrates:
قام، فصففنا خلفه، ثم سلم وسلمنا حين سلم .
“The Prophet ﷺ stood up and we formed a row behind him ﷺ. When he ﷺ gave the salam, we also gave the salam.”
Hafiz al-Nawawi (may Allah have mercy on him) (676 AH) writes:
أجمعوا إذا كانوا ثلاثة أنهم يقفون وراء ه، وأما الواحد؛ فيقف عن يمين الإمام عند العلماء كافة، ونقل جماعة الإجماع فيه .
“The people of knowledge are agreed that when there are three worshippers, two will stand behind the imam; but if the follower is only one, he will stand on the right side of the imam according to all the scholars. A group of the people of knowledge have reported consensus on this.”
Note:
Alqamah and al-Aswad (may Allah have mercy on them) narrate:
إنهما دخلا على عبد الله، فقال : أصلى من خلفكم؟ قال : نعم، فقام بينهما ، وجعل أحدهما عن يمينه والآخر عن شماله .
“The two of them came to Abdullah ibn Mas’ud (may Allah be pleased with him). He ﷺ asked: Have those behind you prayed? They said: Yes. Abdullah ibn Mas’ud (may Allah be pleased with him) stood between the two of them, placing one on his right and the other on his left.”
Abdullah ibn Mas’ud (may Allah be pleased with him) had seen the Messenger of Allah ﷺ do this. Al-Aswad (may Allah have mercy on him) says:
ثم قام فصلى بيني وبينه، ثم قال : هكذا رأيت رسول الله صلى الله عليه وسلم فعل.
“Abdullah ibn Mas’ud (may Allah be pleased with him) led the prayer standing between me and Alqamah. He said: I saw the Messenger of Allah ﷺ do this.”
But this hadith is abrogated; we have already mentioned the abrogating hadiths. Abdullah ibn Mas’ud (may Allah be pleased with him) did not come to know of its abrogation. This is why the consensus of the Ummah came about on acting upon the abrogating hadiths.