i had severe recurrent clinical depression for years . .
i cant speak for your boyfriend ,but i also often withdrawn from other people . and i could appear as selfish and dont think about other people while in fact it is due to my low esteem and depression . i do not want to tell my family whats wrong because i felt i would upset them ,at time i feel like i am a burden and i wanted to let them go.I still Love my family and friends a lot . and nothing can ever change it even if i dont appear to do so .
In the same theory , i think your boyfriend still love you even if he dont care about u as much due to depression .
it is a good idea to seek medical help as it might keep deteriorate ,anti depressent often help alot . and it could improved his behaviour and in a sense improve your relationship right now .
after all , 2 years is not a short time ,All relationship have their up and down . love is not only about those happy time ,it is also about supporting and accepting . i know it is a tough time for the 2 of you right now , but i am sure you can work something out between the 2 of you if you try hard enough .
However . If you feel like you cant cope or it is too stressful for you to manage , it might be best to take a break and give yourself a bit of time off . you could also seek help from helpline and theres many support group for people and their family who deal with mental illness .
good luck , take care , All the best .