Do I need to log out of apps before factory reset?
No. If you reset your device to factory settings, your device will restart with a clean slate. That means it won't have a Google account associated with it. Your Google account is still active, though, and you can easily log back in with your username and password.