Your history suggests he is suffering from IBS OR IBD. other causes need to be ruled out. Various specialists deal with this like gastroenterologist, general surgeon, colorectal surgeon etc.
Next Steps
plant based diet solves almost all digestive problems if followed properly, in correct manner. often MEDICINES have a very limited role in such digestive problems.