Thanks for reaching out.
You can customize password expiration policy for cloud only users from M365 admin centers' Security & privacy tab or using Azure AD cmdlet Set-MsolPasswordPolicy
which applies to all user accounts that are created and managed directly in Azure AD but unfortunately we cannot make a specific password expiration policy for a specific group of users.
The Azure AD password policy doesn't apply to user accounts synchronized from an on-premises AD DS environment using Azure AD Connect, unless you enable EnforceCloudPasswordPolicyForPasswordSyncedUsers.
Refer to the following articles to learn more:
Azure AD password policies
Set the password expiration policy for your organization
Hope this helps.
-----
Please "Accept the answer" if the information helped you. This will help us and others in the community as well.