I’ve been on the other end of this situation, almost exactly. Once you have come to terms with it yourself, tell your husband. I was shocked, but in a way, not surprised. It almost came as a relief. I always knew something wasn’t quite right but couldn’t put my finger on it. When it comes to making decisions about what you’re going to do, put your children at the very heart of it.
For us this meant that, as far as possible, we wouldn’t disrupt their lives. I stayed in the family home and he moved close by to a place where he could have them overnight. They were able to stay at the same schools and do the same hobbies. We worked very hard to remain friends (that took some doing in the early stages). In one sense it wasn’t so hard as that’s what we’d become before the split. We’re now five years on and we have new partners, both of whom the kids get on well with and love. He has become a much better father as he makes more of an effort to be involved, and sees them most days. We even all go out together for family birthdays, and he often stays for a coffee when he drops them off.
He’s much happier now, and a great friend - the way it probably always should have been. It’s not perfect, but then nothing is, and if it was it would be boring, but the kids are happy, healthy, and thriving. Good luck, it will be hard, but it means he’ll be able to meet someone who loves him the way he deserves, and you’ll be happier not having to hide who you are anymore.
(Sorry, that turned into a bit of an essay)