Assalamualaikum Wa Rahmatullahi Wa Barakaatuh
The action of the congregation is initially commenced by an Imam and at least 1 follower. Once this occurs the prayer is considered to be a congregation. Along with this, there are some specific rules regarding the correctness of the congregation. One of those rules is that the Imam must be in front of the followers by at least his feet.
Thus in the case, the Imam is standing alone in a room and the Muqtadis are in a separate room the Imam must still be ahead of the Muqtadis. Also the Imam must know that he is the Imam of the congregation, if he is praying alone in another room and people intend to join in, but join in a separate room this will not be considered jamaat, they must join where the Imam is whether he is in the Jama’ah Khana or a separate room to be considered praying with him. It will only be valid for them to join in the Jama’at Khana in this case if the rows are going into the Jama’at Khana.
Keep in mind that generally, the rule for the Jama’ah is that it can extend as long as the rows continue in the proper sequence.
References:
Al-Hidaya: Kitab Al-Salah, Chapter: Salatul Jama’ah pg 92
Al-Fiqh Al-Muyassar: Kitab Salah: Conditions
Only Allah knows best