I wanted to use the Microsoft Teams app on macOS to login to my personal Office 365 account, but I recently used it to login to my corporate account. That did not work out very well: Teams got into an “endless loop” asking me to sign in over and over again. It looks like Teams has some issues when switching between different accounts.
I got this solved by opening Keychain Access, and deleting the entry called Microsoft Teams Identities Cache. After that, I could sign in to Teams again with the correct account.