Validity of following an Imam when rows are not connected but both are outside the mosque
Chapter on Imamate and Congregational Prayer
Al-Mughni
Book of Prayer
Primary text
If the follower is outside the mosque, or if both are outside the mosque entirely, it is valid to follow the Imam whether the follower is higher or lower than the Imam, by any degree, provided the rows are connected and the person behind the Imam is visible. This applies whether they are in the mosque courtyard, a house, on different rooftops, in open desert, or on two separate boats. This is the view of Al-Shafi'i.
Supporting text
There is a condition mentioned that there should not be an obstruction preventing passage between them, although the stronger view is that this obstruction does not affect the validity of following, as there is no textual or consensus-based prohibition, and it does not resemble matters that impede following, such as minimal separation.