The commander can be attached to a unit and some must be e.g. beserkers. The general still has a 12" radius of command measured from the centre front of the unit. Other commanders can only enhance cohesion when attached to a unit.
Commanders can leave a unit when they wish unless the unit is subject to compulsory moves.
When attached to a unit there is a chance that the commander can become a casualty from shooting or combat when the unit suffers unsaved hits.
If a commander is not in a unit he cannot be attacked.
If he is in the path of a charge or pursuit, move him aside.
The only exception that I know of is the later Persian Great king if he is in a chariot.
Yes, that is correct. A command stand that is attached to a unit may be attacked as part of the unit. Any command stand that is not attached to a unit, may not be attacked on its own.
"Experience is the teacher of all things."
~ Gaius Julius Caesar
The Persian Great King remains an exception. Historically he frequently rode a heavy chariot so the army-list allows it. There are no heavy chariot units for him to join and he cannot join any other unit. See page 16 of the classical lists.
Yes, as Dave said, the Persian Great King is the singular exception. But then, he is also the 'King of the Four Corners of the World,' so he would be exceptional.
"Experience is the teacher of all things."
~ Gaius Julius Caesar