That's a really good question.
I suspect that to be grammatically correct, the phrase ought to be:
Everyone has to decide for himself where he wants to live.
But we try not to use gender-specific pronouns (himself/him) because they exclude females from the "everyone". So to keep everybody happy, you would say:
Everyone has to decide for himself or herself where he or she wants to live.
- but this is very long and clumsy.
So we say:
Everyone has to decide for themselves where they want to live.
because it includes males and females, even though it's grammatically incorrect.
I may be wrong about this, so you ought to wait for other answers as well.
Student or Learner