If the product is sold out, customers will get the “Notify Me” button on that product detail page as you have configured and customized.
By clicking on the, “Notify Me” button, a popup will appear where the customers can fill in their Email ID to get the notification mail when the product stocks are available.
In the Notification popup, they will also get the different selections of the different variants.
In this way, you can configure & customize the “Notify Me” appearance and customize the Email template to send to the customers when the product or its variant is back in stock.