boyfriend ALWAYS upset

Me and my boyfriend have been dating for 7 months and lately he’s just upset/ in bad mood almost all the time. I wouldn’t have a problem with it too much except he withdraws from me both emotionally and physically. I just feel so alone and I don’t even know what to do. I told him I don’t know how much longer I can take his mood but he said if I can’t then to leave him basically because “he doesn’t know when he will be happy again.” He has gone through a lot of tragedy in his life such as his dad dying when he was 14 (he’s 16 now) but a few months ago he wasn’t acting like this. Someone please help because I don’t know what to do about it :(