Imam al-Qurtobi in his tafsir (here of verse (62:9) discusses this topic in his 7th point of discussion and points out at a lot of different opinions:
The inline translation here is of my own take it with the necessary care
قوله تعالى : إذا نودي للصلاة يختص بوجوب الجمعة على القريب الذي يسمع النداء ، فأما البعيد الدار الذي لا يسمع النداء فلا يدخل تحت الخطاب . واختلف فيمن يأتي الجمعة من الداني والقاصي
(when [the adhan] is called for the prayer) is specific for the order of praying the Jumu'ah prayer for close poeple who are able to hear the call. While people whoes homes are far away are not meant by this order. And there's a difference of opinion about whom should assist the Jumu'ah among the proximate and the distant.
فقال ابن عمر وأبو هريرة وأنس : تجب الجمعة على من في المصر على ستة أميال . وقال ربيعة : أربعة أميال . وقال مالك والليث : ثلاثة أميال . وقال الشافعي : اعتبار سماع الأذان أن يكون المؤذن صيتا ، والأصوات هادئة ، والريح ساكنة وموقف المؤذن عند سور البلد
Ibn 'Umar, abu Hurairah and Anas said: Jumu'ah is a due for anybody in the area to a diameter of six miles (according al-Mawsu'ah al-Fiqhiya a mile as stated in some ahadith like here etc. is equal to 1848 meters nevertheless scholar have a somewhat differences on the exact length of this mile). Rabi'a said 4 miles. Malik and al-Laith (ibn Sa'ad) said: 3 miles. A-Shafi'i said: the consideration for hearing the adhan is based on a few conditions that the mua'dhin him self has a loud voice, that all other voices at the moment are rather calm, the wind is calm and that the mu'adhin stays at the extremal walls of the area (city).
وفي الصحيح عن عائشة : أن الناس كانوا ينتابون الجمعة من منازلهم ومن العوالي فيأتون في الغبار ويصيبهم الغبار فتخرج منهم الريح ، فقال رسول الله صلى الله عليه وسلم : " لو اغتسلتم ليومكم هذا "
And in the sahih hadith Narrated by Aisha
(the wife of the Prophet) "The people used to come from their abodes and from Al-`Awali (i.e. outskirts of Medina up to a distance of four miles or more from Medina). They used to pass through dust and used to be drenched with sweat and covered with dust; so sweat used to trickle from them. One of them came to Allah's Messenger (ﷺ) who was in my house. The Prophet (ﷺ) said to him, "I wish that you keep yourself clean on this day of yours (i.e. take a bath)."" (see in Sahih al-Bukhari and Sahih Muslim)
قال علماؤنا : والصوت إذا كان منيعا والناس في هدوء وسكون فأقصى سماع الصوت ثلاثة أميال . والعوالي من المدينة أقربها على ثلاثة أميال .
Our scholars said: if the voice was strong and people were calm and still the maximum distance a voice can be heard is of three miles. And the closest of the villages of Medina was at three miles.
وقال أحمد بن حنبل وإسحاق : تجب الجمعة على من سمع النداء . وروى الدارقطني من حديث عمرو بن شعيب عن أبيه عن جده عن رسول الله صلى الله عليه وسلم قال : " إنما الجمعة على من سمع النداء " .
Ahamad ibn Hanbal and Ishaaq said: The Jumu'ah is a due on those who hear the call. A-Daraqotni narraated from the Haidth of abu 'Amr ibn SHo'ayb from his father from his grandfather from the Messenerg of Allah Allahs prayers and blessing be upon him saod: The Friday prayer is obligatory on him who hears the call.
. وقال أبو حنيفة وأصحابه : تجب على من في المصر ، سمع النداء أو لم يسمعه ، ولا تجب على من هو خارج المصر وإن سمع النداء . حتى سئل : وهل تجب الجمعة على أهل زبارة - بينها وبين الكوفة مجرى نهر - ؟ فقال : لا .
Abu Hanifa and his companions said: It is obliagtory on whom is in the area (city), no matter if he heard the call or not. And it is not a due on those who are outside no matter if they've heard the call or not. Until he was asked: Is the Jumua'h obligatoty for the people of Zabarah -which is separated from al-Kufa by the banks of the Euphrat- He answered: No.
وروي عن ربيعة أيضا : أنها تجب على من إذا سمع النداء وخرج من بيته ماشيا أدرك الصلاة . وقد روي عن الزهري : أنها تجب عليه إذا سمع الأذان .
It was also narrated by Rabi'a that it is obligatory to anybody who hears the call and if he left the house would reach the mosque and pray with the congregation. And it was narrated from az-Zuhri: It is obligatory if one hears the adhan.
While abu Bakr al-Jassas in his tafsir added a discussion on the location for Jumu'ah saying:
فصل واتفق فقهاء الأمصار على أن الجمعة مخصوصة بموضع لا يجوز فعلها في غيره ؛ لأنهم مجمعون على أن الجمعة لا تجوز في البوادي ومناهل الأعراب ، فقال أصحابنا : " هي مخصوصة بالأمصار ولا تصح في السواد " ، وهو قول الثوري وعبيد الله بن الحسن وقال مالك : " تصح الجمعة في كل قرية فيها بيوت متصلة وأسواق متصلة ، يقدمون رجلا يخطب ويصلي بهم الجمعة إن لم يكن لهم إمام " .
The scholars of jurisprudence of the citis have agreed that Jumu'ah is specified by a location and that it is not allowed to pray it elsewher. Because they have consensus (agreement) that it is not allowed to perform it in rural area and distinct houses, our companions (hanafi) have therefore said: " It is restricted on cities and is not valid for villages" And this is also the opionion of a-Thawri and 'Ubayd Allah ibn al-Hassan, while Malik said: " The Jumuah is valid in each village where there are conected houses and conected souks, and if they have no Imam they might ask/chose a man to hold the sermon and lead the congregation".
وقال الأوزاعي : " لا جمعة إلا في مسجد جماعة مع الإمام " وقال الشافعي : " إذا كانت قرية مجتمعة البناء والمنازل وكان أهلها لا يظعنون عنها إلا ظعن حاجة وهم أربعون رجلا حرا بالغا غير مغلوب على عقله وجبت عليهم الجمعة " قال أبو بكر : روي عن النبي صلى الله عليه وسلم أنه قال : لا جمعة ولا تشريق إلا في مصر جامع ، وروي عن علي مثله وأيضا لو كانت الجمعة جائزة في القرى لورد النقل به متواترا كوروده في فعلها في الأمصار ؛ لعموم الحاجة إليه .
Al-Awza'i said: There's no Jumuah unless in a mosque with an imam". A-Shafi'i said: "If it was a vilage with conencted buildings and houses, and if the citizens where not to leave it unless for the reason of need, and they are 40 free men none of them is illminded the Jumu'ah is obilgatory on them" Abu Bakr (al-Jassas) siad: it was narrated from the prophet ALlahs prayers and blessings be upon him that he said: there's no Jumu'ah nor tashreeq except with an area which connects and gathers (people), something similar was narrated by 'Ali, and if the Jumu'ah was allowed in villages then this would have been confiremed by narrations as it was for the case of cities as it is a general necessity.
وأيضا لما اتفقوا على امتناع جوازها في البوادي ؛ لأنها ليست بمصر وجب مثله في السواد وروي أنه قيل للحسن : إن الحجاج أقام الجمعة بالأهواز فقال : لعن الله الحجاج يترك الجمعة في الأمصار ويقيمها في حلاقيم البلاد فإن قيل : روي عن ابن عمر أن الجمعة تجب على من آواه الليل ، وأن أنس بن مالك كان بالطف فربما جمع وربما لم يجمع ؛ وقيل من الطف إلى البصرة أقل من أربع فراسخ وأقل من مسيرة نصف يوم .
Also as they agreed on the invalidity or denial for its permission in villages and rural area the same applies for far distante (lone) houses and homes. And it was nararted that al-Hassan was informed that al-Hajjaj has lead the Jumu'ah in al-Ahwaaz (which apparently was not yet settled at the time) He said: May Allah curse al-Hajjaj for leeving out Jumu'ah in a urban area to pray it in the throats of the land, so if it was said: It was narrted from ibn 'Umar that Jumu'ah is obligatory on those who has been shelterd by night, and that Anas ibn Malik was in a-Taff and maybe he prayed Jumu'ah or not, and that the distance between a-Taff and al-Basra is less than a quarter of a farsakh and less than the walk of half a day.
قيل له : إنما هذا كلام فيما حكمه حكم المصر ، فرأى ابن عمر أن ما قرب من المصر فحكمه حكمه وتجب على أهله الجمعة ، وهذا يدل على أنهم لم يكونوا يرون الجمعة إلا في الأمصار أو ما حكمه حكم الأمصار .
Then it can be answered: This statement is about that which has a ruling which is similar to that of an urban area, as ibn 'Umar held the opinion that what is close to an urabn area has the same ruling and therefore Jumu'ah is obligatory for the people living there and all this shows that they didn't consider Jumuah as obligatory unless for urban citizens and people from areas which are considerd as likewise.
This fatwa on islamweb quotes the following views on the location:
- The Hanafis say: Jumuah is only preformed in a urban area (and what is close to it) and define it as a location where there is either a ruler or a person who has been assigned by the ruler to apply and survey the punishments and rulings of shari'a.
- The Shafi'is say: that it must be performed in a location that has conected buildings or buildings surrounded by a wall.
- The Malikis say: something similar to the Shafi'is but in theri case any building for example even wooden or palm leaf buildings would be sufficient, while tent's are not sufficient for considering such a location as permissible to pray Jumu'ah at as it is not built by any means or local traditions/standards.
- The Hanbalis have any of these condistions, so Jumu'ah prayer in their case is allowed anywhere. Imam al-Bukhari has put a chapter title in his Sahih called "To offer Jumu'ah prayer and Khutba in villages and towns" in which the hadith:
The first Jumua prayer which was offered after a Jumua prayer offered at the mosque of Allah's Apostle took place in the mosque of the tribe of 'Abdul Qais at Jawathi in Bahrain. (Sahih al-Bukhari)
Is mentioned. This view was considered as the closest to truth by the authors of the linked fatwa. While islamqa says otherwise.
As for the settelement and citizenship the scholars have also mentiond a few conditions to Jumu'ah My source is Islamonline):
The Hanafis said it is necessary to stay at the location at least for 15 days to be ordered to pray Jumu'ah.
The Maliki's say one must have the intention to stay at the location forever to be ordered to pray it for example if you had the intention to stay at a location only one months Jumu'ah wouldn't be a due for you as the rulings of a traveling person apply on you.
The Shafi'is and Hanablis consider a stay of at least 4 days to make Jumu'ah a due on a traveling person, why settlement is rather a condition for praying Jumua'h in the location. To make it a bit clearer: 40 people out of the congregation must at least be settled in the area, but people who are staying there at least 4 days must join the congregation!