When a character enters a location, it is added to the end of the list of characters already there. The unit that has been in a location the longest will appear at the top of the list.
If a character leaves a location and later returns, it will be put at the end of the list again.
For example:
Seen here: Candide [1269] Osswid [5499] Feasel the Wicked [1109]
Candide has been here longest, followed by Osswid, then Feasel. If Candide were to leave and return, he would appear at the end of the list.
If a character unstacks from beneath another unit, the character will appear just after the unit, rather than at the end of the list.
For example:
Seen here: Candide [1269], accompanied by: Osswid [5499] Feasel the Wicked [1109]
Osswid is stacked beneath Candide. If Osswid unstacks, he will appear after Candide, not after Feasel:
Seen here: Candide [1269] Osswid [5499] Feasel the Wicked [1109]