Hello Pranjal ,
You can get 8 digit code from the authenticator app as well but it will be for a different account . You should have setup a passwordless logon where you get a key symbol on top of the user ID . You get this option when you go to
https://account.microsoft.com/profile/ and setup authenticator App to go passwordless. This one, when you setup will provide you 8 digit codes.

You would have setup Two-step verification (https://account.live.com/proofs/manage) on the same account at some point as well either in the same authenticator app or in some other instance of any TOTP
app (similar apps like MS authenticator app which generate one time codes) You will need to disable Two step verification . Two step verification provides 6 digit codes.


It might have happened that you might have set both the above while working in the flow but are missing to recall which device you set it earlier. If you are unable to find the second device or second account in authenticator or any other app then you may
need to reset the same. While setting up the two step verification , you may have provided your phone number / alternate email address. You may need to try to reset the password by going to login.live.com and trying to resetting the password as a last resort
using the following.

Provide your logon ID and then click next .

Please click "Forgot Password" follow the instructions as below.


Click Show more verification methods here.

Select Text number which you had setup at that time.

You can provide your phone number and a code will be sent to your number where you can logon . Once you have logged in I would suggest you to go to https://account.live.com/proofs/manage and
disable Two step verification and also disable all the identity apps. and once that is done , you can setup the two step verification again .
I hope this helps you recover the account. In case the information provided is helpful , please do mark it as answer so that it is helpful to other community members searching for similar queries.
Thank you.
Please take a moment to "Mark as Answer" and/or "Vote as Helpful" wherever applicable. Thanks!!