What rules exist to get accommodation regarding coursework due to a depression?
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.