In the example, we set the default role to Subscriber, but you can set your desired role by changing “subscriber” on line 4 to the desired role.
PHP
add_filter('woocommerce_new_customer_data', 'wc_assign_custom_role', 10, 1);
function wc_assign_custom_role($args) {
$args['role'] = 'subscriber';
return $args;
}