You can not do this without writing some php.
Logged in users have a $my->id greater than zero. So, you must perform this check:
<?php
global $my;
if (intval($my->id) > 0) {
echo '<a href="#">logout</a>';
} else {
echo '<a href="#">login</a>';
}
?>
Alternative to $my->id > 0 you can use the group id: $my->gid <> 29
The same functionality for Elxis Nautilus:
<?php
if (eFactory::getElxis()->user()->gid <> 7) {
echo '<a href="#">logout</a>';
} else {
echo '<a href="#">login</a>';
}
?>