Oh that's tricky. If there was no good reason why the marriage was not valid, then the first marriage stands as the real one. The second one cannot be valid in that case, and there is a state of continuing adultery going on. So he has three choices, not all of them equal. He can go back to his first wife, if possible. He can separate from his second wife and live alone. Or he can stay with his second wife and live like her brother, maybe in a separate bedroom, most likely in a separate bed, as legally married but only as friends, not friends with benefits. Otherwise the continuing adultery thing would prevent him from receiving the Eucharist, at least as long as the first wife lived.
Since there are children involved, and there would be a grave injustice to separate from them, it might be best to follow the last option. Particularly if there are small children. But then the initial divorce would have also been an injustice, so justice might require him going back to his first real wife. If she would have him. In a situation like this a lot of people stand to be hurt. He would have to consider all of them. His new wife, his original real wife, all the children.
He should not be having sex with anyone not his real first validly married wife. If he does forego sex with anyone else, he can be forgiven, of course, and things may be messy, but he walks anew in his rather awkward situation. This isn't the normal answer you would expect society to give, because whatever anyone feels the need to do is OK with society. But Christian marriage is a sign of the permanence of the relationship of the Church to Jesus and Jesus to the Church. As such, if it is a real and valid marriage there is no undoing it as long as they both live. He has to give faithful witness to his first valid marriage. Either by going back to her, or separating from all others, or at least being chaste in living in the house of another woman.
The Church should be helpful to people in these sort of situations. Not to give a wink and a nod but to help them live with the things they have to do to get it right, or as close to right again as possible. None of the people involved should be excluded. He will have to make some changes though.