Install the rule template. Make sure you get the 4.0+ template. MQTT Event Bus [4.0.0.0;4.9.9.9]
Configure your MQTT broker with an event channel and the Groups as described in that link.
Create a new rule and choose that as the template. Fill in the properties.
That’s it. The whole point of rule templates is they are installed and configured. You don’t need to edit the rule.