We congratulate you both for repenting from the sins that you committed, which is by the grace of Allaah to you both. Allaah calls all His believing slaves to repent, as He says (interpretation of the meaning):
“And all of you beg Allaah to forgive you all, O believers, that you may be successful”
You should realize that Allaah rejoices at the repentance of His slave. The Prophet (peace and blessings of Allaah be upon him) said: “Allaah rejoices more over the repentance of His slave when he repents to Him than one of you who was on his mount in the wilderness, then he lost it, and his food and drink are on it, and he despairs of finding it. He goes to a tree and lies down in its shade, having lost hope of finding his mount, and whilst he is like that, there it is standing in front of him, so he takes hold of its reins and says, because of his intense joy, ‘O Allaah, You are my slave and I am your lord,’ making this mistake because of his intense joy.” Narrated by al-Bukhaari (5950) and Muslim (2747).
You should realize that Allaah has promised to turn bad deeds into good deeds. Allaah says (interpretation of the meaning):
“Except those who repent and believe (in Islamic Monotheism), and do righteous deeds; for those, Allaah will change their sins into good deeds, and Allaah is Oft‑Forgiving, Most Merciful”
But this depends on the repentance being sincere. The conditions thereof are:
1.Giving up the sin
2.Regretting what one has done
3.Resolving not to go back to it.
Undoubtedly what your wife did is a bad thing, but now she has repented from it, so we hope that because of her repentance she will go back to the way she was before, or become even better.
We cannot be certain that it is better for you to stay with her, but we say to you:
If you think that her repentance is sincere, and that she deeply regrets what she did, and that she has changed for the better, and her sin will not had any negative effect such as making you doubt her and hate her, then what we think is that you should keep her, so as to maintain her repentance and protect your children from being lost.
We hope that her case is like this, and that you will keep her in kindness, and that what she has done will not affect you, especially since you say that you also committed sins and immoral actions before Allaah enabled you to repent.
Undoubtedly your falling short with regard to her rights played a major role in your wife’s turning against you and falling into sin, even though it does not justify what she did. You have to watch yourself and fulfil the rights that Allaah has enjoined you to give to your wife and children.
One of her rights over you is that you should help her to repent sincerely and guide her towards good and warn her against evil. It is not permissible for you to allow her to visit those who play a role in corrupting her and leading her astray, even if they are the closest of people to you. You are a shepherd and the head of your household, and Allaah will ask you about your flock and whether you neglected them or did the duties that Allaah enjoined upon you.
What we think is that you should conceal her sin and appreciate her repentance and stay with her. It is not diyaathah (cuckoldry) to keep her after she has repented, rather diyaathah is keeping her when she has not repented and is persisting in having haraam relationships, which is what we hope she has repented from sincerely.
And Allaah knows best.