When the remaining product is purchased, for example your last keyboard, the quantity changes from 1 to 0 but you find that the product disappears from the website and not marked as sold out.
To enable this:
Always take a backup of your database
1) Go to configuration
2) Click Stock
3) Set the following option to ‘Product Status in Catalog when Out of stock should be set to’ = 1 Leave Product Status On
4) Show sold Out image in place of Add to cart = 1