How to put the logout link in the menu item?
You can use [fms_logout_link type="URL"] shortcode for Profile Builder add-on or [epb_logout_link type=”URL”] shortcode for Elegant Profile Builder Plugin with Shortcodes in Menus plugin to achieve this.
How to display the logout link in the menu only for logged in users?
You can use Menu Item Visibility Control plugin to achieve this.