Concealment abilities will hide your units from enemy units when in the right terrain, unless the enemy units are adjacent or have True Sight.
Concealed units in enemy domain will not trigger the "Enemy in domain" penalty as long as they remain concealed. However, if they enter a structure (e.g. Gold Mine) in the domain, they will trigger a notification "structure xx occupied" to its owner, even if they do not stay on this structure, thus revealing their passage.
The AI follow the same rules regarding concealed units, with a few specificities:
If the concealed unit becomes visible, even only for 1 hex (e.g. crossing through a Fertile Plain between two hexes of Forest for a unit with Forest Concealment in the range of vision of the AI), then the AI will know the position of the unit for a few turns (even if it becomes concealed again).
The AI takes into account concealed units in a city when calculating the strength of that city, even if it does not see them.
This means that concealed units need to remain concealed all the time they are in the vision range of enemy units (and never enter the vision range of units with True Sight) to be truly concealed.