depressed and don’t know what to do with life

been together for 3 years with my boyfriend. he’s been acting weird and saying we aren’t together and that he doesn’t love me anymore and that he needs some space and to figure out his life before he bes with me or someone ... im hurt. idk what to do... but the thing is that he keeps taking to me texting me and kissing me and taking me to shop and go eat.. So idk maybe he does what to be with me but he doesn’t want to show it? we were having problems too A lot and i guess he’s tired of it .. he’s giving me mixed signals and sometimes when i text him he’s a dick to me .. idk i dont want to lose this guy. i want to marry him and have his kids but he’s pushi me away and doesntwant to work it out ... he’s older than me too he’s 27 and im 23 im so depressed