Hi @Danylo Novohatskyi : Azure AD Dynamic Group can be created by defining the expression ( refer screenshot ).
You can use any of the custom attributes as shown in the screenshot which are not used/defined for any user in your Azure AD, which will help to create a dynamic group in Azure AD which will exclude the users in Azure AD.
Thanks for leveraging Microsoft Q&A community forum. Please let us know if this answer was helpful to you. If so, please remember to mark it as the answer so that others in the community with similar questions can more easily find a solution.