I was going through the same thing with my bf. He would hide, so well it was almost like I had an imaginary bf at times.
With time, patience and communication, he has stopped retreating into his man cave all alone.
For him it was a combination of depressive isolation, fear I would end up walking away, and also not wanting to share his troubles.
Things changed very gradually...
At first I told him I need some type of warning he's going to withdraw or go incommunicado, for my own sanity. This he agreed would be the considerate thing to do, but he didn't want to talk about his feelings... I in turn promised not to pry, that he could share only if and when he felt comfortable, that all I needed to know was, "I need some alone time".
So that's how it started, a small yet significant change...
Guess from there he grew willing to make more changes.
Currently it looks like he may be headed for another episode, but he's reaching out, being communicative about what he's going through and is more receptive of me being supportive of him.
I guess for me it was easier to understand because I've had my own battles with depression, except I have people to answer to when I need to hide (like my daughter) and my bf doesn't.
I feel for your situation, and I hope your loved one feels better soon, but please don't forget to look after yourself while breaking your back trying to be there for them