Enter ‘sold out’ text
You can specify the text to display with out of stock variations by going to WooCommerce > Settings and select the Better Variations tab.
Ensure that ‘Show unavailability text’ is checked then enter your own text in the ‘Unavailability text’ field.
Enable stock management for variations
For this to work, you need to ensure that your variations have stock management enabled.