@Houman Alavehzadeh, Thanks for posting in Q&A. The error message "At least one rule must be specified" suggests that Intune is not recognizing the rule you've defined in your JSON file.
Discovery script detects the settings from the JSON file. The JSON file defines the custom settings and the values that you considered to be compliant.
After reviewing the discovery script and JSON file, I find the format is not correct.
https://learn.microsoft.com/en-us/mem/intune-service/protect/compliance-use-custom-settings
For discovery script, it Identifies one or more settings, as defined in the JSON, and return a list of discovered values for those settings. You can change the script to add one variable to detect the windows update status and return the value with example like "return $hash | ConvertTo-Json -Compress"
For JSON File, we need to define the custom setting windows update status which you define in discovery script and the value we consider it to be compliant.
https://learn.microsoft.com/en-us/mem/intune-service/protect/compliance-custom-json
Here are some examples you can read as a reference:
https://call4cloud.nl/custom-compliance-policy-intune/
https://patchmypc.com/intune-compliance-policy
Note: None-Microsoft link, just for the reference.
Hope the above information can help.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.