What rules exist to get accommodation regarding coursework due to a depression? I am writing this after much consideration, in a hope that I will be able to get practical thoughts to deal with the situation. I have recently been diagnosed with major depression. Although I have never talked about it in public, most of my life so far I was dealing with it without even knowing there is a help out there. Most of the time I will just ignore or pretend that I am feeling nothing. My emotional ups and downs have been a major barrier in my progress. I found myself most of the time pushing myself with extra motivation, but then again it wears off.

Most of my academic life I have been told that I am not consistent. In my high school, I would do very good in one term and then I would do very bad in the next. I was in no category. My teachers thought I am good student but I just simply don't study sometime that's why I am not consistent. But I know the hard truth. Listening to sad songs, feeling sad for simple reasons, getting angry and feeling lonely, I thought all these are internal characteristic of me that I can never overcome. After my high school, with lots of motivation, I was able to get into one of the top-50 colleges in the US. Note that I am an international student. I made that with financial grant and scholarship from that college.

After I came here, I already felt the cultural difference but I was quick enough to blend in. However, my depression was not. I worked hard to sound and speak like native speakers and learned English fluently, although I was still struggling with my emotion. I was even embarrassed to talk to anybody because there are so many talented students in our school from all over the world and I was feeling like an imposter. Then I saw this view on growth mindset by Prof. Carol Dweck and I decided no matter what happens, I will make it to graduation.

I am rising senior now. With all that rickety events in my academic progress, I was still hanging in there and then decided to get expert helps.It was then when I learned about my depression. I just started to take medication. This semester at one point I was so depressed that I did not go to take an exam. I was diagnosed with major depression after that period. Most of my professors were kind and gave me second chances in terms of homework and lab work. However, this particular professor seems not to have any empathy whatsoever. I tried my best to make him understand but he insists that I drop out of the course. And if I drop out then I have to take the course in summer, which will jeopardize my internship offer. Another class next semester follows this class and I must take this class now in order to graduate on time.

I would like to know if there is any rule in academia for students with a mental disability that will help me at this point and also do you have any suggestion for me for making my academic experience much better in general, considering my situation.
There is a structure for dealing with this in the U.S.: a Section 504 Accommodation Plan.  If you get your health status established with the Office for Students with Disabilities (it might have a slightly different title in your school), you won't have to negotiate directly with an individual professor.  That office will do that for you.

Your school should have instructions posted online, and you can also email, phone or visit.  I will warn you that some of these offices are warm and fuzzy and supportive and some are not.  You might do well to start assembling some preliminary documentation before meeting with them.  If you could ask around in your university to find out what others' experience with that office has been, that could be helpful.

You will need medical documentation of your diagnosis, how it affects your ability to function academically, and recommendations for accommodations.  It is often helpful to brainstorm a list of accommodations you think could be helpful, and share it with the medical provider who is going to be your primary documenter.

In the long run, I think it will be helpful if you can build your identity as a student with a disability in a broader way than "student with major depression," and see yourself as part of a larger group of students with many different types of disabilities.  I love this article that documents the beginnings of 504: https://dredf.org/504-sit-in-20th-anniversary/short-history-of-the-504-sit-in/

I have to warn you that in some places it can take a while to get this set up.  Since you are almost done, it could be a frustrating process.  But if you have any interest in grad school, it would be worthwhile, in the long run.