As someone who lives with depression and anxiety, I can assure you that neither of these things justify being an asshole to people who you supposedly care about.
While you can be supportive, it's still on him to put in the actual work to manage these and any other issues (getting professional help as necessary) in order to best hold up his end of the relationship and deserve you. If he isn't ready and willing to do that, he isn't ready and willing to be in the relationship.