How do you tell someone you love that you need spaces

My boyfriend and I have been together 3 years. He's definitely the clingy type. He's a loner and has no friends. Most of the people in his life whom he loved has died. His dad was murdered in front of him when he was 12. His brother died from cancer when he was 15. His sister died from a drug overdose when he was 18. He lost two friends to suicide. One of them being his best friend. His mom abandoned him when he was 3 and she died back in December. So he doesn't really have anyone and doesn't really attempt to make friends or be around people. He's a virtual school teacher so he works from home. I love him but he always wants to go everywhere I go and doesn't want to go places if I don't go with him. Everytime I hang out with my friends he tags along. I want to tell him to go out and try to make friends or his own but idk how to say that without coming off at mean. Same with telling him I need space. I'm not sure how to do it without coming off as mean