Ref. No. 38 / 1156
In the name of Allah the most Gracious the most Merciful
The answer to your question is as follows:
Having sexual relation before marriage is Haram. Hence both must repent to Allah at earliest. However, if they married and later they repented to Allah then too Nikah is valid. But they must hurry to repent to Allah for their sins.
And Allah knows best
Darul Ifta
Darul Uloom Waqf Deoband