Offering the prayer in congregation in the mosque is obligatory for men who are able to do it, according to the more correct of the two scholarly opinions, because of evidence mentioned previously in the answers to questions no. 8918 and 120.
If you can hear the call to prayer, then what you are required to do is to pray with the congregation in the mosque. You should advise the imam and tell him what is Sunnah; then if he insists on offering duÂ‘aa' in unison, do not join in the duÂ‘aa'. See questions no. 10268 and 105644.
What is meant by hearing the call to prayer is that if the individual can hear the adhaan in a normal voice without a loudspeaker, if the muÂ‘adhdhin raises his voice, and there is no wind or noise, or other things that may affect one's ability to hear it.
If you cannot hear the call to prayer, then it is permissible for you to pray in the prayer room in your residence; in that case you should weigh up the pros and cons, such as if your attending the mosque will result in your having contact with ordinary people and calling them and teaching them. In that case, it is more important for you to pray in the mosque than to pray in the prayer room in the student residence, and so on.
And Allah knows best.
Reproduced from Islam QA