Scholars adhere to one of the following three opinions regarding the ruling of praying in the congregation:
First, it is compulsory for all duty-bound (mukallaf) males. This was the view of Imam Ahmad bin Hanbal and a handful of the salaf. This is the opinion of a minority of scholars.
Second, it is an emphasized sunnah or recommended action. This was the position of Imam Malik, Abu Hanifah, and many Shafi’i scholars.
Third, it is a communal obligation, which means that if a few people in a specific community are praying in congregation, the duty to do so is removed from the rest. However, if no one prays in the congregation, every man in the community will be held accountable. This is the view of most/majority of Shafi’i scholars and many Maliki and Hanafi scholars.
Since you requested the majority’s opinion, it is difficult to determine whether the second or the third opinion is the majority opinion. However, we incline to the third opinion as it appears to reconcile the many ahadith narrated about this issue.
According to the third position, the communal obligation is fulfilled if the prayer is performed openly and publicly, establishing the shi’ar of prayer. One does not need to perform it in a masjid (Majmu). Nevertheless, many virtues of praying in a masjid and numerous ahadith encourage it.
Some of these narrations seem inclined toward performing salah compulsorily in the masjid. However, this is a minority opinion. The majority regard praying in a masjid as highly recommended but not compulsory.
And Allah knows best.