Advice?

I've been with my boyfriend for about three years... at first everything was great but about a year and a half everything went downhill. He was super sneaky with all his personal things, and I'm not asking why. I'm not dumb every time I would get a hold of it I'd see things I didn't want to see. Then he would beg for me back and every time I go back to him :( he promises me he will stop and he does for a few weeks then it's right back to the way things used to be. He purposely does things he knows really bother me, and always says he likes to see me get mad. I try so hard to ignore it and think nothing but good things but I find myself frustrated. Even when it's a new day I think about all the mean shady things he's done to me in the past and it makes me mad and I start treating him badly because I'm subconsciously thinking about them. I don't understand why after all this crap I don't just leave.... I find myself constantly going back to him and I know it's partially my fault 😓 please no judgement I just don't know what to do