With the Automatic Role Changer plugin you can automatically assign roles to your customers depending on a specific purchase or amount spent.
If you combine this plugin with YITH WooCommerce Subscription, the customer will automatically get the role you have set when the subscription changes to status ‘active’ or ‘trial’. The role will be removed automatically when the subscription gets the status ‘paused’, ‘pending’, ‘overdue’, ‘cancelled’, ‘expired’ or ‘suspended’.
You will only have to activate both plugins in order to make them work together. For more information on how to create a rules, check the full documentation here.