Praise be to Allah, the Lord of the Worlds; and may His blessings and peace be upon our Prophet Muhammad and upon all his Family and Companions.
According to the correct opinion of the people of knowledge, congregational prayer is obligatory.
There are evidences about this in the Book of Allah and the Sunnah of the Prophet (Sallallahu Alaihi wa Sallam).
Allah says: "When you (O Messenger Muhammad (SAW) are among them, and lead them in As-Salât (the prayer), let one party of them stand up [in Salât (prayer)] with you taking their arms with them;" (An-Nisa 4:102)
So Allah ordained us to perform congregational prayer even in a state of fear and war, and it is more appropriate to offer congregational prayer in time of peace.
Al Bukhari and Muslim reported in their Sahih, and the wording is Muslim's, that Abu Hurairah said: "The Prophet (Sallallahu Alaihi wa Sallam) noticed that some people did not attend some prayers he said:" I was about to order a man to lead the prayer (instead of me) then I would go to the people who do not come join congregational prayer, then I would order that fire be set their homes. Had any of them realized that he would find there (at the prayer) some tasty meat, he would have attended it (meaning Isha prayer)."
So the above is evidence that congregational prayer is obligatory, and not attending it without a sound valid reason is a great sin.
Moreover, some people of knowledge are of the view that whoever prays in his house without a sound reason, his prayer is invalid, as the Prophet (Sallallahu Alaihi wa Sallam) said: "Whoever hears the call to the prayer, and does not come to it, his prayer is not valid except if he has a sound excuse." (Reported by Al Hakim, Ibn Majah, and Ibn Hibban, with an authentic chain of narrations. The Hadith is also narrated by Ibn Mas'oud and Abu Musa, (may Allah be pleased with them.)
Therefore, one should avoid missing congregational prayers in the mosque without a valid excuse.
Allah knows best.