The compounds in coconut oil that make you poop are medium-fatty triglycerides. It's called MCTs for short. When you consume coconut oil, these MCTs will break down into glycerols and medium-chain fatty acids (MCFAs).
MCFAs are well-known for its ability to quickly convert into fuel. When your bowels absorb MCFAs, they literally "wake up"! They become more energetic in pushing the stool forward with more relaxation and contraction of intestinal muscles.
In the meantime, glycerols from the coconut oil breakdown will gather and attach water molecules to the stool. With water, your stool becomes softer. And that's briefly how coconut oil make you poop.
Of course, the more coconut oil you consume, the easier it will make you poop. Not forgetting that you must drink enough water to make this whole action happen.