Speak neurobiology to people who don't believe in the mind.
First off, recognize for your own sake that this is a neurobiological problem. That's kind of trivial, the mind appears to be some sort of neurobiological phenomenon, and this is some big systematic problem with your mind hence your neurobiology. Your advisor does not seem to recognize it as such and thinks it is "just a mental thing", it's just some small issue of tastes or preferences and you're being a prima donna by making a big stink about it.
But you can speak to such a person in their language. It is not hard to give an explanation that will give scientifically-minded people a feeling of the importance. Here's a try at one:
We all have this stress hormone called cortisol in our brains that, when we get a dose of it, it makes our stomach churn and the world seems more silent and your eyes get more open in a sudden panic. I happen to have had a lot of exposure to it, and my brain is now doing something like an allergic reaction, where when it sees something mildly stressful it gives me an unbelievably huge dose of it. My doctors say that I need to get away from situations that are causing me stress so that the levels can go down so that hopefully my body stops having this stupid reaction. Because the lab causes these minor stresses that seem like nothing to you but explode in my brain, I cannot come into the lab for the rest of my leave-of-absence. I can of course come in after that but this is a real problem that requires my rest and attention, just like how you don't walk on a broken leg.
I'm not even saying that this is your problem; I'm just saying that if you rephrase it in those sorts of objective terms rather than "I am really sad all the time and I have no energy," people who normally would say "suck it up and get back working!" will instead say "oh, that totally makes sense, I'll see you in a few months."
Tips on resolving conflict better.
Now, one thing that makes depression worse is that people don't really understand how to talk to each other about situations of conflict. I will summarize quickly a conflict-mediation course and say: you cannot change how your advisor talks to you, but you can change how you talk to your advisor. You can make certain choices which will make him feel subconsciously less threatened and more likely to open up, and once he is open to that relationship this will at least allow him to hear your needs and hopefully work together with you to find a solution that meets everyone's needs together. You may not be able to do this with people with certain "personality disorders" like psychopaths and shameless narcissists, but for the average person you can. The first two take a little more explanation, the last two pieces of advice are pretty straightforward:
- Take note of his value-judgments about the situation like "this is awful, how am I supposed to run my lab if you're off being lazy and sleeping all day", so you notice that he tried to express value-judgments like "awful" and "lazy". Most people quietly absorb that negativity and lash out back with other bad feelings: but you can also take a step back, "he is no world authority on awfulness or laziness, so I'm just going to observe that that's what he said but not think that it's really the truth, or even what he really feels." Observe it more neutrally and then it will "get to you" less.
- Repeat what you've heard and try to ask him about what's making him feel those ways, getting him to focus on real causes. Now this takes some work because if you ask someone "why do you feel I'm being lazy?" they'll say something like "because you're doing lazy things!" and get trapped in a circular reference. One key is to ask "what does he have at stake in things?" and more generally "what fundamental human needs that everyone has, does he have, which are being threatened by these events?". So it's better to ask something like "are you saying that you're worried about laziness because you want to keep seeing progress on this other student's work, and you're worried that it will get slower and lead to slower publications if I can't help out?" or something specific like that. And if the answer is "no," then hopefully they follow it up with "it's more like, I have to meet this or that deadline otherwise the grant people start asking what's been going on and I don't have anything to tell them" and you can maybe make progress to what's really bothering them. (To the extent that value-judgments bug us, they either impinge on our desire for a good reputation or else only our own value-judgments bug us. If someone else says "I hate you" you either respond "what's wrong with me?" or "what's wrong with him?!").
- You can try to give the other person's needs and wants a thorough hearing in this way before you try to raise your own, "here's what's at stake for me, how do we pursue a better course of action together?". Most couples will have an argument like "He never listens to me." "Of course I listen to you, I always listen to you." "See! You're doing it right now!" -- you can sidestep all of this stuff by instead focusing on that need-to-feel-heard.
- Before you say something, try to see whether your language implies that something they did was intrinsically, morally wrong; people usually get very adversarial when they get accused of wrongdoing, which kills the prospects of negotiating a better outcome for the both of you. Instead of offering your own value-judgments, try to offer neutral observations. Don't say "you obviously hate me" or even "you're yelling at me" but "I don't know if it's intentional or not but I've noticed your voice getting a bit louder." Because the follow-up to "you hate me" is "I hate you" and the follow-up to "you're yelling at me" is "stop yelling!" but the follow up to "a bit louder" is "I'd feel more comfortable at this volume" which opens a sort of common communication channel. Neutral observations give the other person the room to wriggle out of the blame that's in their own psyche, and normal people will respond to that room by giving you more room.
Talk to the right person
At both the European and American universities I've studied at, you shouldn't be talking directly to your professor about this issue. The right person to talk to is probably someone who coordinates students' successful graduations from the Master's program. This person usually has to look through every Master's student's transcripts and say, "do they have all the required courses" and then look at their internship write-up and say "did they do a plausible bit of work at that internship?" and then eventually they rubber-stamp the thing and send it on.
Even if they don't know directly how to resolve the issue, they probably know a better person to talk to about the issue. The issue from their perspective is, there is an obstacle preventing you from completing your Master's in a timely fashion. This could be lab assistants who do not work safely in the lab or who threaten to hurt you; but it could also be professors who try to get you to work when you need to focus your attention on getting well. They will give you information on how much can be transferred to a different lab with a different professor, if that's the issue. Or they will tell you, "hey, he can't actually do that and here is the ombudsman that you need to file a report with" or so.