Nowhere do the facts say X is insane, so this question asks you to infer a state of mind from behaviour. The Principle excuses a person who, because of an unsound state of mind, could not know the nature of his act, or could not know that it was wrong or contrary to law. Only one of those needs to be true.
So read X's conduct as evidence. He throws a three year old into a well and the reason given is that the boy should have a good bath. That belief is not one a person who understands wells and small children can hold. Then he waits ten minutes, unbothered, which is not how someone behaves who knows a child is drowning below. Then he jumps in himself, partly to bathe and partly to fetch his son, and ends up needing rescue from the villagers along with the boy. Nobody planning a killing walks into the same well as the victim. Every piece of this points one way: X did not know the nature of what he was doing.
Let's summarize:
The answer is option (C).