All perfect praise be to Allah, The Lord of the worlds. I testify that there is none worthy of worship except Allah and that Muhammad is His slave and Messenger.
First of all, both of them, we mean the girl and the boy, must hasten to make sincere repentance to Allah, especially given that this act took place during the ‘Iddah. The conditions of repentance are explained in fatwa 86527.
We point out here that one must beware of any means that could lead to Zina (adultery), especially avoiding being alone with women and entering upon them without restrictions.
If they both sincerely repent, then they may get married after the end of the ‘Iddah, which ends by delivering the baby. For more benefit, please refer to fatwa 83176.
You have asked us another question before stating that the matter was only that the head of the penis touched the vagina without penetration; which means that it is not real Zina; rather, it is figurative zina. This type of Zina is not included in the statements of the scholars regarding the ruling of marrying a woman who committed Zina.
The Fiqh Encyclopedia reads, “It is forbidden for a man to sit between the four parts (arms and legs) of a non-Mahram (marriageable) woman (i.e. placing his male organ between her thighs without penetrating her; this necessitates T'azeer (disciplinary punishments), but the jurists (scholars of Fiqh) unanimously agreed that sitting between her four parts does not lead to the rulings of having sexual intercourse.”
Therefore, there is no impediment that they get married in this case (after the ‘Iddah) under all circumstances.
Allah knows best.