wa alaykum salam wa rahmatullah,
When you are distant from the masjid, it is not obligatory upon you to pray in congregation there. You have to pray at home though. It is good to do it in together if you can, whilst you are at home.
There is a fatwa fatwa by Shaykh ‘Abd al-‘Azeez ibn Baaz (may Allaah have mercy on him), when he was asked about a man who lives in a house far away from the mosque and has to use a car to go to the prayers because if he goes on foot he sometimes misses the prayer, but he can hear the adhaan over the loudspeakers. Is there any sin on him if he prays at home with three or four neighbours in the home of one of them?
The Shaykh replied:
You have to pray with your Muslim brothers in the mosque, if you can hear the adhaan in your home at a normal volume without the aid of loudspeakers, when other sounds are silent and there is nothing to prevent you from hearing it.
If you are far away and cannot hear the adhaan without the loudspeakers, it is permissible for you to pray in your house or with some of your neighbours, because it was proven that the Prophet (peace and blessings of Allaah be upon him) said to the blind man when he asked him for permission to pray in his house: “Can you hear the call to prayer?” He said, “Yes.” He said, “Then answer it.” Narrated by Imam Muslim in his Saheeh. (fatwa Islamqa)