Complex sentence: After several people die, they realize they can vote for who dies; when nobody votes, one is selected randomly.
Split into simpler sentences: After several people die, they realize they can vote for who dies. When nobody votes, one is selected randomly.