It sounds like candida could be causing you're problems.Gas from candida can be from either when it feeds or from undigested food. So far from what you've said I'm thinking maybe something like Ashwaganda could help in the beginning to reduce you're cortisol and help you're body digest better and help you're immune system fight back. Meditation and exercise are good for this too but Ashwaganda can help in addition. But anyways if you'd like me to think more on what's going on with you then here are some questions you can answer.
Do you notice your symptoms are worst after consuming more carbs?
Do you sweat more then normal and do you sweat a lot at night?
Do you notice any not completely digested food in your stool? I know gross question sorry but if you do then there's ways to tell whether it's protein or fat or carbs.