I'm confused

So my boyfriend and I have been dating for 3 years. At the end of our first year he told me he didn't love me and of course it broke my heart because I'm crazy about him. We broke up and literally the day after he said "you can stay!" He said he didn't know why he said it. It happened again the 2nd year right at the end of it and told me again. Same thing happened, we broke up and got back together. I still hold a grudge and I'm not sure what to do. He gets mad that I can't let it go and I try but it just pops back in my head sometimes and I just get upset.