Children are obligate to attend mass when they reach the “age of reason”; basically, when they have some concept of right & wrong and what is going on in the world around them. This is generally accepted to be around the age of 7.
Before this point, it makes no spiritual difference to their souls if they are in church or not. I know some people love to show how their 3 year old knows to bow or say “Jesus”. But I do not believe it has a real impact on their spiritual formation. (This is my personal opinion.)
Ideally, children under 7 would be left home because (again in my opinion) they are a major distraction to their parents and the congregation at large. However, this is not always an option for parents, so unruly children in mass should be treated with love. The same goes doubly true for their parents!
Many churches have established nurseries or “Sunday school” for young children during popular masses. I highly encourage parents to use these services! By not taking your extremely young children to mass, you remove the temptation to focus on something other then God.
It also makes mass seem like a “grown-up” activity to your children. Anyone who knows children knows that they can’t wait to do “grown-up” activities. By creating a waiting period and sense of expectation to attend mass, you physiologically make the experience more desirable and attractive to children.