There are two mosques close to one another, and the second one has few or no worshippers. In which of the two mosques should he pray?
Question

We live in a neighbourhood where there are two mosques close to one another. One of them is usually filled with worshippers, whereas in the second there are no worshippers, so sometimes the mosque doesn’t even open. In that case, which is better: to pray in the mosque that is full, or to pray in the other mosques so as to revive it? Secondly – may Allah bless you – the imam in the mosque that is full does not pay attention to the Sunnah; he lets his garment hang below his ankles, and does not pay attention to the Sunnah. In the other mosque, the imam is somewhat committed, as much as he can, to the Sunnah. We hope that you can clarify in which mosque it is better to pray.
Praise be to Allah.Firstly:
The proliferation of mosques, even in the same neighbourhood, is a good sign, because it is something that encourages the people to offer the prayer in the houses of Allah. But at the same time, we should point out several things:
1.. Mosques should not be built very close to one another, lest that cause the Muslims to separated. There may be some element of extravagance and competition in building them, and some of them may be closed for some of the prayers because there is no one praying in them.
2.. Jumu‘ah prayer should not be offered in both of them; rather it should be offered in the larger mosque, so that the worshippers may gather in one mosque.
3.. Building mosques in areas where there is no mosque at all is more important than building them in places where there are already mosques that are sufficient for the worshippers.
Secondly:
Based on the situation that you have mentioned, we think that prayer should be offered in the first mosque, for several reasons:
1.. If the worshippers gather in one mosque that will create harmony among them and increase the ties among them, so that it will be known who among them is sick, so that people may visit him, and who is poor, so that he may be helped, and who has passed away so that the funeral prayer may be offered for him and condolences given to his family.
2.. The mosque in which the people of the neighbourhood all pray will help to teach them and exhort them, unlike the case if they are scattered in more than one place. Then if a teacher comes to teach them, or a preacher comes to exhort them, the people will all have gathered in one place, so the goodness and benefit will reach all of them.
3.. The greater the number of worshippers in a congregation, the more beloved it is to Allah.
It was narrated that Ubayy ibn Ka‘b (may Allah be pleased with him) said: The Messenger of Allah (blessings and peace of Allah be upon him) said: “For a man to pray with another man is better than his praying on his own, and if he prays with two other men, that is better than his praying with one other man. The greater the number, the more beloved it is to Allah, may He be exalted.” Narrated by Abu Dawood (554) and an-Nasaa’i (843); classed as hasan by al-Albaani in Saheeh Abi Dawood.
Shaykh Muhammad ibn Saalih al-‘Uthaymeen (may Allah have mercy on him) said:
If we assume that there are two mosques, one of which has a larger congregation than the other, then the best is to go to the one that has a larger congregation, because the Prophet (blessings and peace of Allah be upon him) said: “For a man to pray with another man is better than his praying on his own …”
This is general in application. So if there are two mosques, one of which has a larger congregation than the other, then the best is for you to pray in the one that has the larger congregation."(Ash-Sharh al-Mumti‘ ‘ala Zaad al-Mustaqni‘  4/150-151).
The shaykh also said:
It is better for one who is not stationed to guard the border to pray in the mosque where there will be prayer in congregation if he attends and there will not be prayer in congregation if he does not attend, such as if there is a mosque in which people pray, but there is a man who, if he attends and leads the prayer, then the prayer is held in congregation, and if he does not attend, people pray separately. So it is better for this man to pray in this mosque, so that it will function as a mosque, because if he does not attend the mosque will not be functioning properly, and it is not appropriate for mosques not to function properly. So for this man, his praying in this mosque is better than his praying in a mosque that has a larger congregation. But this should be contingent on a condition, which is that the mosque should not be close to another mosque that has a larger congregation, because in that case it may be said that what is best is for the Muslims is to pray together in one mosque, because this is better than their being scattered. So if we assume that this mosque is old and is attended by five or ten men, and near it is another mosque that is attended by a large group, and it is not too difficult for those who pray in the older mosque to go to the larger mosque, then perhaps it may be said that what is best is for them to join the other mosque and gather there, because the larger the congregation, the better it is."(Ash-Sharh al-Mumti‘ ‘ala Zaad al-Mustaqni‘  4/150).
You should advise this imam, in the hope that Allah will guide him and enable him to follow the Sunnah and be eager to do so.
Finally, we would advise you to pray in the mosque with the smaller number of worshippers if the people of the other mosque are known to resent the Sunnah and to oppose it and those who adhere to it, and if you have fulfilled the duty of advising them, but to no avail.
In that case, your praying in the mosque in which the Sunnah is upheld and you will be able to teach it to the people is undoubtedly better. But so long as the matter has not gone that far, we think that you should all gather in one mosque.
May Allah help and guide you.
And Allah knows best.