Hello,
You mention setting up a dynamic rule, a feature which is is only available in Workplace, and not in standard Moodle. How about first checking the documentation Dynamic rules, then if your problem remains unresolved, maybe you could contact your Moodle Partner?