Please check the documentation section, it's explained how to create a logout button on your page:
As for the condition value - select the identity binding returned from your user details action. Click your button, select dynamic attributes - show: and bind identity binding.
If it has a value, the button will be displayed.