How to remove password expiration in Azure AD
To follow this guide you will need:
The correct role: the Password Administrator, or Global Administrator roles are needed to perform these steps.
Navigate to the Password expiration policy section of Security and Privacy page in the Microsoft 365 admin center.
Uncheck the box that says "Set user passwords to expire after a number of days"