Noncombatant mode is a special status forbidding combat. It is usually seen when armies are located in enemy territory when a war ends. A noncombatant army shows a white flag, and cannot enter combat by any means, until it returns to normal status. Fleets are never noncombatant.
Noncombatant status is not the same thing as retreating. The two are similar in that in both cases, combat is not allowed. However, a noncombatant army retains its freedom of movement; in fact it is less limited than normal. A retreating army is much more limited.
Entering and Leaving Noncombatant Mode
An army enters noncombatant mode in only one way: when it is currently in a province which, because of changing conditions, it is no longer allowed to be in. By far the most common situation is when you make peace: suddenly all those armies which you have in enemy terrain are not supposed to be there. However, it is also possible for province ownership to change underneath an army. And you may also take control of armies in places they are not allowed to be when you annex a country.
A noncombatant army returns to normal status immediately when it enters any province that it is normally allowed to move into. If the status of the province it is currently in changes, such that is now allowed to be there, cancelling a move counts as "entering" that province, and will accordingly work.
Effects of Noncombatant Mode
The primary effect of noncombatant status on an army is that so long as it persists, that army cannot be in any battle. Battles can take place in the same province, even battles involving friendly troops, but the army will not join them.
A noncombatant army has slightly relaxed movement conditions. In addition to being able to plot moves normally into provinces which it is allowed to enter, it is also allowed to plot moves into provinces owned by the owner of the province it is currently in. Thus, it can move around the enemy country freely; it is not required to exit directly or expeditiously. It is this aspect of noncombatant mode that makes possible the exploit/tactic of white flag tourism.
One other effect of noncombatant mode on the army is that it lowers morale by about 1/4 or so of maximum, per each month that it persists. (I don't know the exact effect -- research is needed.) Thus, if an army stays for very long in noncombatant mode it will gradually be driven down to minimal morale.