When you log out of Facebook on the app, your only logged out on the Facebook app. If you go to Facebook on Messenger. Settings>Privacy and Terms>tap 3 lines in top left. You're on Facebook there. To log out of Facebook Messenger, scroll down the Facebook menu to "log out". Then you will be logged out in both apps.