On July 01, 2019, Microsoft updated its support page, in which the company said if your account have been remained unused for more than two years, your Microsoft account will be deleted without issuing any warning. The new account policy will be effective from August 30, 2019.
However, there are a few exceptions to this new policy for Microsoft account, you can read these exceptions below:
★Purchases. If you have used your Microsoft account to purchase, or to redeem or access a purchase of, a current Microsoft product or service, your Microsoft account will remain active and Microsoft will not close your account due to inactivity. Note, this does not apply to gift cards, certifications or subscription-based purchases or services.
★Subscriptions. Your Microsoft account will continue to remain active for so long as you have an active Microsoft subscription associated with your Microsoft account. Following the expiration or termination of the subscription, you must sign in to your Microsoft account at least once in a two-year period to keep your account active.
★Publishing to the Microsoft Store. If you have used your Microsoft account to publish applications or games (including game DLCs) to the Microsoft Store or to register for a Microsoft Partner Center account, your Microsoft account will remain active and Microsoft will not close your account due to inactivity.
★Certifications. If you earn a certification from Microsoft using your Microsoft account, your Microsoft account will remain active and Microsoft will not close your account due to inactivity.
★Account Balance. Your Microsoft account will continue to remain active for so long as you have an unspent balance in your Microsoft account (e.g. from a Microsoft gift card or a credit from Microsoft). If you live in a jurisdiction where gift cards are considered “unclaimed property,” Microsoft will, pursuant to local law, escheat the unspent balance associated with your Microsoft gift card.
★Accounts Payable. Your Microsoft account will continue to remain active for so long as there is an amount owed to you by Microsoft associated with your Microsoft account (e.g. amounts due to you from Microsoft Payment Central).
★Family Accounts. If you have an inactive Microsoft account that has granted consent for an active Microsoft account belonging to a minor, Microsoft will not close your Microsoft account due to your inactivity. Your inactive Microsoft account will be kept open by Microsoft until the minor’s account (i) is deemed inactive and closed by Microsoft, (ii) is closed by you, or (iii) transitions into a standard Microsoft account when the minor reaches the requisite age of majority in their region.
★Legal Requirements or as otherwise provided by Microsoft. Notwithstanding the foregoing, Microsoft reserves the right to maintain your account status as active, or not to close an inactive account, as required by applicable law or regulation, or as otherwise provided by Microsoft to you.
Source: https://support.microsoft.com/en-in/help/4511051/microsoft-account-activity-policy