Assalamualaikum ustaz. There are some who prefer to pray on a different level of a mosque separately even when there are still empty spaces in the main prayer hall. Hope for an explanation on this matter.
Alhamdulillah, praise and gratitude to Allah SWT for His countless blessings for us all. Praise and salutations to our beloved Prophet Muhammad PBUH, his family, companions and all those who follow his footsteps until the Last Day.
The act of straightening and filling the saf is a commandment before a person prays. The reason is numerous hadiths mentioned the rewards of this act. Furthermore, this act is included in the sunnah matters that should be performed before prayer. 
Among the hadiths which state this is a narration from Ibn Umar RA, where the Prophet PBUH said:
وَمَنْ وَصَلَ صَفًّا وَصَلَهُ اللَّهُ، وَمَنْ قَطَعَ صَفًّا قَطَعَهُ اللَّهُ
“If anyone joins up a row God will join him up, but if anyone breaks a row God will cut him off.” 
This hadith discusses the importance of straightening the saf and filling the empty saf is included as straightening the saf. In Aun al-Ma’bud, the author stated when discussing this hadith that it means whoever enjoins the saf is someone who comes and fills the empty spaces in the saf. As for the meaning of Allah SWT enjoins him is Allah SWT enjoins His blessing to him. While whoever cuts the saf and let empty spaces be or placing something to prevent this (from the saf filled). Moreover, Allah will cut him means cutting him off from Allah SWT’s blessings and perfect protection. 
According to the above question, there are several matters that should be understood in answering this question. We start by listing the conditions of qudwah (following the imam) according to madhhab al-Syafie in general:
- The makmum’s position must not be ahead of the imam.
- The makmum must know the changes in the action of the imam.
- The makmum must set the intention to follow the imam.
- The makmum must follow the type of prayer the imam is performing which is the same form. 
- The makmum cannot contradict the imam in sunnah actions that clearly involves the movement of the body such as the sahwi and tilawah prostration.
- The makmum cannot contradict the imam for more than two requisites, whether he precede or late than the imam.
- Both the imam and makmum must jtima’ (gather) in one place. 
The condition of ijtima’ is different for a prayer performed in or out of the mosque. If it is in the mosque, among the conditions are that nothing is separating the makmum to reach the imam even though he has to reverse or turn away from the qibla. The reason is a mosque is built with the purpose of congregational prayer, thence every ruling of worship performed in it considers the situation for congregational prayer. 
Whereas for qudwah outside the mosque for one of them, whether it is the imam or makmum is outside the mosque, the conditions are as follows:
- No separator prevents musyahadah (looking at the imam or makmum whose qudwah with the imam is valid)
- There is no barrier for istiraq (the makmum can walk to the imam without reversing or turn away from the qibla)
- Does not exceed 300 dzira’ between the imam in the mosque and the makmum outside. 
Furthermore, Imam al-Nawawi also said: “A makmum must not precede the imam in terms of his position. If he is ahead of the imam, then his prayer is invalid according to qaul jadid. And does not harm (congregant) if he is in line with the imam and sunnah for him to be a little behind the imam and one considers this based on the position of the heel.” 
In answering the above question, we divide the situation as the following:
First: The Imam and Makmum Are in the Same Mosque
Imam Ibn Hajar al-Haitami stated in the chapter if the makmum and imam is in the same mosque: “It is valid through ijma’ although the distance is far and the building has a route and door that connects it.” 
Thus, based on the above-stated explanation, the qudwah of a makmum who follows an imam who is far from him in a mosque is valid on the condition that it is connected or has a route that he can walk through without any barrier.
Second: Makmum on the Rooftop of the Surrounding Building and the Imam is in the Mosque
Imam al-Nawawi said: “If the makmum is on a high platform and the imam is at ground level or vice versa, (the qudwah is valid) on the condition that some parts of the makmum are in line with the position of the imam’s body.” He further said: “It is makruh if the position of the makmum is higher than the imam or vice versa, except when there is a need, then it is sunnah.” 
Whereas, Imam Ibn Imad said: “If one prays on the rooftop outside of the mosque then him following the imam is invalid for he is on a different building and the imam and makmum is not in line. Such is stated by Syeikh Abu Muhammad, if a makmum stands in the mosque’s courtyard, then the ruling is the same as a mosque. As for the yard outside of the mosque, Imam al-Rafi’e said the jumhur scholars said that it is just like the mosque and makmum following the imam is valid.” 
According to the above argument, in our opinion if there is still space in the main prayer hall, then it should be filled first according to the hadith narrated by Anas bin Malik RA where the Prophet PBUH said:
سَوُّوا صُفُوفَكُمْ، فَإِنَّ تَسْوِيَةَ الصُّفُوفِ مِنْ إِقَامَةِ الصَّلاَةِ
“Straighten your rows, for the straightening of the rows is part of prayer.” 
The reason is the main prayer hall is the place of prayer and it should be filled first.
However, if the guard who was on duty has to pray far from the main prayer hall because he is on duty, then we state that his prayer is valid and he is given facilitation in terms of filling the saf.
 For example, it is impermissible for a person performing the obligatory prayer to follow an imam who is performing the sunnah funeral or eclipse prayer and vice versa. (Refer al-Taqrirat al-Sadidah, pg. 296)