Praise be to Allah.
If a person comes to the mosque and finds that he has missed the prayer in congregation, it is prescribed for him to pray in congregation with others who also missed it, or with other worshippers who pray with him as an act of charity, because of the reports narrated by Abu Dawood (574) from Abu Sa’eed al-Khudri (may Allaah be pleased with him) that the Messenger of Allaah (blessings and peace of Allaah be upon him) saw a man who was praying alone, and he said: “Will any man be charitable towards this one and pray with him?” The hadeeth was classed as saheeh by al-Albaani in Saheeh Abi Dawood.
If he knows that the congregation in the mosque has ended and he is in his house, then he may pray with his family or he may go to the mosque to offer the prayer there with the second congregation.
Shaykh Ibn ‘Uthaymeen (may Allaah have mercy upon him) was asked: What is the ruling on having a number of prayers in congregation in a mosque which has a regular imam and a regular muezzin?
He replied: Having a number of congregations is divided into two categories. The first category is when that is done regularly so that the second congregation deliberately comes late in order that a second congregation may be done. This is an innovation, because only one congregational prayer should be done in the mosque.
The second category is when that is not done regularly and deliberately, but after the first congregation ends some other people come into the mosque and they offer their prayer in congregation. This is prescribed and is Sunnah, because the Prophet (blessings and peace of Allaah be upon him) was with his Companions one day, and a man came in who had missed the prayer, and he said: “ Who will be charitable towards this man and pray with him?” and one of the Companions got up and prayed with him.
And because the Prophet (blessings and peace of Allaah be upon him) said: “A man’s prayer offered with another man is better than his praying on his own, and his praying with two other men is better than his praying with one other man. The more there are the more beloved it is to Allaah.”
With regard to the notion held by the people that having a second prayer in congregation is an innovation, that is correct if it is done regularly and deliberately. But if it happens occasionally, then having a second prayer in congregation is Sunnah, because of the command of the Prophet (blessings and peace of Allaah be upon him and his family).
Question: Even if it is done in the house after the first prayer in congregation has ended?
Shaykh: No, in the mosque is better, because if it is done in the mosque the size of the congregation may increase and people who come later may join it, so that will be better. Moreover, sometimes people go from their houses to the mosque in order to pray with the congregation, but they may miss it and find that they have already prayed, in which case praying in the mosque is better for him and others, because if he and his companion return home and offered a prayer in congregation there, another person may come after the first prayer in congregation has ended and find no congregation, so he misses out on praying in congregation. So it is better for it to be in the mosque.
Yes, if we assume that he knew when he was at home that the prayer in congregation had ended, then in this case we say: It makes no difference, pray in your house, because if he goes out to the mosque he may feel embarrassed to meet people when they are coming out from the prayer, so he may pray in his house.
But if he has come and entered the mosque, and found that they have already prayed, he should not leave. Rather he should pray with the congregation in the mosque. End quote from Liqa’ al-Baab al-Maftooh, 41/12.
A congregation may consist of two people, an imam and one who prays behind him. If a man is excused for not praying in congregation or he has missed the prayer in congregation, and he prayed with his wife, then this is a congregation and his wife should stand behind him.
See also the answer to question number 98739.
And Allaah knows best.