There are many questions here:
Distance
In an outdoor minyan, two conditions must be met - all participants must hear the shliach tzibbur, and must be able to see each other. Below is a quote from
Minchas Yitzchok.
תלוי בשמיעת הש"ץ המבואר (באו"ח סי' קכד), וברואים זה את זה, והיינו
אפילו אם המה בשני חדרים לגמרי, ומקורו מדברי הרשב"א (בתשובה סי' צו).
ואף דלהלכה יש חולקים ומחמירים וכמבואר שם בשערי תשובה (אות מז), מכל
מקום באין מחיצה מפסיק ביניהם, אף שאינם בבית אחד אלא בשדה שפיר יש לומר
דמהני רואים זה את זה לכו"ע
Location
Regarding indoor Minyanim, there is another possible requirement, subject to debate between the Poskim. Some require all members of the minyan to be in the same room (without a halachic mechitza); others require at least ten to be in the same room - after which others can be mitztaref from another room; some permit even if the minyan is split between two rooms (as long as there is no public domain in between them).
The Shulchan Aruch (55:13) requires all participants of the minyan to be in one place. [See further, how this limitation can be circumvented.]
צריך שיהיו כל העשרה במקום אחד ושליח צבור עמהם
In the laws of Zimun (where a minyan is required to add the Divine Name אלקינו), ten people are considered a minyan even if they are split between two rooms, provided that they can see each other (see Shulchan Aruch 195). The Rashba (Responsa 91) says it's possible this law extends to Tefilla as well:
עוד אני אומר שאפשר לומר שכל שרואים אלו את אלו כאילו הן בבית אחד דמי
ומצטרפים. ודומיא דזימון של ברכת המזון דתנן (ברכות פ"ז מ"ה) שתי חבורות
שהיו אוכלות בבית אחד בזמן שמקצתם רואים אלו את אלו, הרי אלו מצטרפים
לזימון
This suggestion of the Rashba is codified by the Mishneh Berurah (OC 55, Note 52) and Biur Halachah (ad loc).
Other authorities disagree - see, for example, Mishkenos Yackov (#75).
Reshus Harabim splitting a minyan
The source to permit minyanim in two different places is based on the Rashba, who equates the rules of tefilla to that of zimmun. Accordingly, one of the caveats that applies by zimmun will also be relevant here.
In the laws of Zimmun, the Shulchan Aruch (195) writes that when two groups are joining together to form a minyan, a reshus harabim passing in between is mafsik (breaks the connection):
שתי חבורות שאוכלות בבית אחד או בשני בתים, אם מקצתן רואים אלו את אלו
מצטרפות לזימון, ואם לאו אינם מצטרפות... ויש מי שאומר שאם רשות הרבים
מפסקת בין שני הבתים, אינם מצטרפין בשום ענין.
[Although the Shulchan Aruch quotes 'יש אומרים', which leads some to suggest that in a time of pressing need this opinion can be disregarded, the Kaf HaChaim writes that there is no opinion who disagrees.]
The Pri Megadim (Ashel Avraham, OC 55) rules that this limitation applies to tefilla too:
וכן מה שכתוב שם רשות הרבים מפסקת אין מצטרף, הוא הדין כאן
The Taz (195:2, quoted in Mishneh Berurah) explains that the definition of reshus harabim in this context is different to the regular definition in regards to Shabbos, and here it includes even a private pathway.
נראה דלאו דוקא רהות הרבים ממש שהוא רחב י״ו אמות אלא אפי׳ שביל היחיד מפסיק
ביניהם כדתנן ריש פאה ומייתי לה בחזקת הבתים דף נ״ה דזה מפסיק בין
הרשויות לפאה ולשבת וא״כ ה״ה נמי כאן דחד טעמא הוא עם רה״ר
Some contemporary poskim (see R' Moshe Shternbuch) ruled that this problem applies only to those standing on ground floor; those in upper level floors standing on balconies would not suffer from this problem. Others (see here) disagree.
As a resource for further treatment on specific scenarios, see here and here. [I don't know the authors, and caution readers to make their own careful judgment.]