Your question has more to do with culpability than it has to do with anything else, and that is a sticky subject.
For a sin to be mortal it must:
- be a grave matter.
- be consensual
- be done by someone who can understand what is going on.
So if a three year old fires a gun and kills someone, that would be a grave matter, the act might have had consent of the will, but does the child understand? Probably not (not impossible, but probably not).
I believe I read this in a commentary on the Code of Canon Law (but maybe not), but the loose standard for full culpability is a rule of sevens.
- Under seven you almost certainly cannot have a full understanding of the consequences of actions.
- Between seven and fourteen, you probably do not have full understanding of the consequences of actions, but it is possible that you do.
- Between fourteen and twenty-one, you probably do have full understanding of the consequences of actions, but it is possible that you do not.
- Over twenty-one you are almost certainly capable of understanding the consequences of actions.
Obviously there are exceptions, but those are guidelines.