Minor correction first: Bacterial endospores don't result from one cell differentiating into a different cell type. An endospore is not a cell type, but rather a protein structure that first forms inside of a mother cell, carrying all of the necessary machinery and genetic material to remain viable outside of the mother cell and eventually form a new cell when it encounters the right environmental conditions. In a sense, it's more like a mother cell becomes an endospore through the process of sporulation, which (with any luck) eventually becomes a new vegetative cell through the process of germination.
Bacterial endospores tend to form when cells encounter environmental stresses (like lack of nutrients, changes in pH or temperature, etc). Generally speaking only a portion of bacterial population will sporulate under a given set of conditions. However the remaining cells don't necessarily die right away. They may remain viable for quite some time, depending on how much and what type of stress they are experiencing.
Sporulation efficiency (the percentage of cells in a population that sporulate) is governed by a number of different environmental and genetic factors. Some organisms require specific nutrients or vitamin cofactors to sporulate efficiently. Others may require a specific pH range temperature. And different strains of a given organism can have wildly different sporulation efficiencies, making it hard to provide a very specific answer to your first question.
Q: When do Bacillus subtilis cells die vs form endospores?
The broad answer is that cells sporulate when they encounter the proper environmental cues in a medium containing all of the required nutrients in the correct amounts. And the ones that don't form spores don't necessarily die (it's not often an either/or scenario). You can look at a sporulation protocol for B. subtilis to get an idea of what makes them sporulate (see page 9 of this document).
Because sporulation requires time, vegetative cells will simply die if you assault them with something that kills them fast enough, or otherwise prevents sporulation from happening. But in most environments (outside of a lab), bacterial populations are heterogeneous and will likely already consist of a mixture of spores and vegetative cells. So when you try to kill them with something like that only kills vegetative cells, like a solution of ethanol, you are simply killing off the vegetative cells, leaving behind a preexisting population of spores to germinate and grow when conditions change again.
Also, could there be dead endospores?
Yes (assuming you consider endospores to be living). In practice, and population of dormant organisms will have some members that are no longer viable. Spore stocks in long term storage will slowly lose viability over time. There's also a lot of basic and translational research on how to most efficiently and effectively kill bacterial spores, especially those of sporulating pathogens in sensitive environments like hospitals or assisted living facilities (the answer is bleach. It's always bleach).