Boyfriend confusion

So I just went through my on and off again boyfriend (of about 3-4 years)phone and messages (without him knowing of course) and I found out he’s been sexting a man. Things haven’t been going super well in our relationship lately. I’m super insecure and DO push him away but I’m in total shock right now. He says he’s not gay or bisexual he’s just texting and never meeting or talking to the guy. He said he likes the attention and likes feeling wanted. He said I don’t make him feel liked or wanted at all. Is he bi? Or is it just for the attention? Someone please help I need opinions. Is this cheating? I feel like it’s (emotional) cheating or whatever you want to call it. He proved to me and I have a son from another person whom he’s been treating as his own. I dont know what to do.