I'm very sorry, but there's nothing you can do. If he's gay, your marriage is not going to work. It's not that he doesn't love you, but he just doesn't feel physically attracted to women. If you end your marriage cordially, it would be possible for him to remain in your life and your children's lives. That would be the best option, should he wish to divorce you in pursuit of a man.
Please try your best to understand that this is in no way any fault of yours, and that he does love you, just not the same way you love him. And he also loves your children, I'm sure. Believe that he has tried his best at wearing the hard hat and loving you and your kids as a normal husband and father. But when you're gay, it's just not possible. He's not weak for giving in. In fact, he's strong for admitting it to you. I'm sure he texted instead of saying it face-to-face because he loves you and witnessing your anguish would be more than he could bear.
Once again, try to understand. This is neither your fault nor his.