since you have long time loose stools, sure must have got treated by anti-bacterial and anti-parasitic medicines. so, get colonoscopy
done once, if nothing can be found out, mostly it is IBS
(irritable bowel syndrome
). it can be treated by gut sterilizing antibiotic, some pro-biotic and amitriptaline. sue you will be benefited from that.
wishing you good health.