@D E Thanks for posting in our Q&A.
Based on my research, the rule may be:
(user.assignedPlans -any (assignedPlan.servicePlanId -eq "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" -and assignedPlan.capabilityStatus -eq "Enabled"))
For more details, please refer to the following link:
https://cloudyhappypeople.com/2019/06/26/create-a-dynamic-rule-based-on-user-license-plan/
Note: Non-Microsoft link, just for the reference.
In addition, we can skip the PowerShell section in the above link to find the ServiceplanID info by going to this Microsoft Page. https://docs.microsoft.com/en-us/azure/active-directory/enterprise-users/licensing-service-plan-reference
Hope it will 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.