The only form of exercise which has been convincingly demonstrated to be helpful for depression and/or anxiety problems is resistance exercise, ie weights. The reasons are not known.
What about cardio exercises? There is "suggestive evidence" that it could be useful, but it has not been convincingly demonstrated.
My advice to everybody, regardless of personal emotional issues: Do weights, do cardio, do calisthenics. You will thank yourself.