your poop is green due to the following:
It may be normal as a result of eating large quantities of vegetables, such as spinach or mallow
It may be the result of taking nutritional supplements or as a result of a change in the diet followed, causing an irregularity in the digestive process
Taking antibiotics or other medications
Infection with viruses, parasites, and some bacteria can cause green stools
The bile usually dissolves as it passes through the intestine, but if you have diarrhea or other stomach cramps, the bile will not dissolve well, leaving a greenish effect due to the green color of the bile salts.