The tough thing about talking mental illness is that trying to determine it just from actions is really just looking at a deviance from the norm for that action. Some can be very clear, like reasoning that involves hallucinated talking dogs. Some can be slightly less clear, like believing an all-powerful entity has commanded you to kill through an ancient document. Some can be downright murky, as revenge for actual terrible slights.
-Lone man kills a room of people because Ronald McDonald told him he was the chosen one: Crazy
-Lone man kills a room of people because they were witches and God says you shall not suffer a witch to live: ?
-Group of men kill a room of people because they were witches and God says you shall not suffer a witch to live: Terrorism in the US / Religious Police in Extreme Muslim Country
-Lone man kills a room of people because all of them were directly involved in denying insurance payment for his wife to get a life-saving treatment to save a few bucks: ?
-Lone man kills a man who tortured and murdered someone he loved: ?
-Group of men kill a room of people who were complicit in torturing and murdering someone they loved: ?
It is really tough to determine just on the act. Someone could be justified in something but still be crazy. Someone could do something crazy but really feel it justified.
Groups probably tend to require more rationale overall, but the quality of that rationale isn't universal. Some things on the fringe, like comet-watching suicide cults will seem crazy to nearly everyone. But, say, killing someone because they stole your wallet is going to seem less crazy to some groups of people and more crazy to others.
In short, except in extreme cases, you pretty well have to find out the nature of the person and their motive to really know. Without a clinical diagnosis, you won't be able to tell between crazy, terrorist, and normal people doing something they think makes sense and you do not.