I accidentally became a side dude

I'm so fucking screwed right now and idk what to do. I have 3 kids and I'm terrified. This whole situation started about 6 months ago. I've been in a situationship with a guy(I'm bisexual) and he's a great person. When we met online he told me he was in a very abusive relationship with a women and he only married her because his parents pushed towards it and he's gay. He said she left him and used to beat on him all the time. I felt bad for him and I don't want to say our relationship is only sexual because I do genuinely enjoy his company whether we have sex or not. My ex wife only knows about him because she came by when he was leaving my house but she thinks he's just a friend. I am deeply in the closet. I got a message from his wife last night that they're actually still together and were still living together which I had no idea about! But she doesn't even seem to care. She told me that I could keep fucking her "faggot" husband if I want to but she is trying to blackmail me into money or she's telling my whole family and I'm worried my ex will try to take my kids. I know technically its illegal to take kids because their parents are gay but where I live she would try. I ended up confronted him and he started crying and he admitted they still lived together but weren't together together. And I asked if he lied about everything but he said he swore there was abuse and I can find her DV charges because their public record. He said he's sorry he wasn't completely honest and begged me not to go because he hasn't been this happy in a long time and I needed time to think first. I don't like being lied to but he truly seems sorry. But I also now have to deal with his wife.