control order status change in woocommerce code example
Example: woocommerce_order_status_changed add action
add_action('woocommerce_order_status_changed', 'woo_order_status_change_custom', 10, 3);
add_action('woocommerce_order_status_changed', 'woo_order_status_change_custom', 10, 3);