My partner has depression and I don’t understand. Please help

Cl

My boyfriend of 2 years has just come out with that he is depressed. I know he has been about 5/6 years ago but that was in the past. He is very stressed at work and has started getting erectile dysfunction. We as a relationship are/ were very good. Yesterday he was in a strange mood and finds it incredibly hard to open up. I don’t understand depression and was probably asking the wrong questions and putting too much pressure on him to talk about it. Today we argued about it and he went home because he wanted to be alone. He isn’t talking to me much and I’m very worried. I just don’t know what to say because he is pushing me away. I know he loves me but I am struggling to understand as he isn’t talking about it. He says he is overthinking everything and that everything is wrong. But looking as an outsiders point of view all I can see wrong is how stressful work is. He said he can’t please everyone and is struggling. I’m looking for advice on how to deal with this and help him before he pushes me away too far. He has doctors on Thursday so obviously wants to do something about it. I’m just confused as to why it has happened all of a sudden and why he wants to be alone for a few days. I’m worried and scared for him