Praise be to Allaah.
The person who is junub must do ghusl in order to pray, and his prayer is not valid without it, because Allaah says (interpretation of the meaning):
“O you who believe! Approach not As‑Salaah (the prayer) when you are in a drunken state until you know (the meaning) of what you utter, nor when you are in a state of Janaaba (i.e. in a state of sexual impurity and have not yet taken a bath), except when travelling on the road (without enough water, or just passing through a mosque), till you wash your whole body”
And the Prophet (peace and blessings of Allaah be upon him) said: “No prayer is accepted without purification.” Narrated by Muslim (224).
This is a matter upon which there is scholarly consensus.
Al-Nawawi (may Allaah have mercy on him) said: The Muslims are unanimously agreed that prayer is haraam for the one who is impure, and they are unanimously agreed that prayer is not valid if he does it, whether he knows that he is impure or he was unaware of it or forgot it. But if he prays out of ignorance or because he forgot, there is no sin on him. If he knew of the impurity and the prohibition on praying when impure, then he committed a grave sin, but in our view he does not commit kufr thereby unless he regarded that as permissible. But Abu Haneefah said: He does commit kufr because he took the matter lightly.
Conclusion: it is a sin, do it is like zina and other sins. That is if he was forced to pray when impure. End quote from al-Majmoo’ (2/78).
The one who is junub must do ghusl first, then pray, even if doing ghusl means that he will miss the prayer in congregation.
See also question no. 94311.
And Allaah knows best.