Hello, friend!
You can disable the password validity or set retained historical passwords to 0.
Option 1: Disable "Password Validity", which means the password will never expire.
Option 2: Set "Retained Historical Passwords" as 0, which means the storage will not record history passwords, no way to check whether the new password is the same as the old password or not.
Follow the below guide to set security policy:
1. Log in to DeviceManager.
2. Choose Settings > User and Security > Security Policies.
3. Configure an account policy.

Hope this helps!