Given that they already have two children, he should do what he can to keep this family together for the sake of his children if nothing else. If he wants this family of his to work out, he needs to figure out what her motivations are and why she wants to go.
What "family"? This is an illicit union, and the two shouldn't be together at all. Man and woman here CANNOT stay together, living in sin ... unless they get married ASAP. Unfortunately, the two fornictaors (adulterers?) brought children into the world, but based on this man's morals or lack thereof, what does it even matter who gets custody?
But, in short, they're required to separate anyway due to the sinful nature of this cohabitation. Under some very strict circuмstances, the Church will allow a couple with children to continue living together but ONLY if there can be assurances that they'd carry on as brother and sister and that there would be no scandal.
But the end cannot justify the means, and the "good of the children" cannot justify continuing to live in a state of mortal sin.
So it's completely moot to speak of keeping some "family" together when they are required to separate due to God's moral law.
And what does an "affair" mean? Since they're not married, it's not as if this woman would be violating any rights a true husband would have to fidelity. She's ALREADY in an affair with the current man.