I have set up both Hotmail and Outlook emails on Mail.
It might be the way you are setting it up.
In Mail for a Hotmail email address you use Microsoft Exchange.
I am not sure how far you got with setting up Hotmail so I'll start fem the beginning.
- Add Account via the Internet Accounts in System Settings
- Use the "choose from a list." option, do not put your email address in the the box.

- Use the Microsoft Exchange option

Enter your name and hotmail address in the appropriate boxes and click on Sign in

Sign in again.

You are going to have to Verify Your Email by some means. Be it with another email or by a password or code.

I used my password.

Once Microsoft servers have verified you, this screenshot should appear.

Choose what you want or don't.

Once you have got it set up in Internet Accounts rename it from Microsaoft Exchange to Hotmail.

Hopefully that helps. I doubt that you can use a code since you seem to need Microsift Authenticator