There refers to a place or introduces a sentence — over there, there is a problem. Their shows possession — their house. They're is short for "they are". Three spellings, three jobs, and the tests are simple: their contains "heir" (an owner), and they're expands to "they are".
The core difference
Three homophones with three distinct grammatical roles.
- there — a place, or a sentence-opener: put it there, there are four options.
- their — belonging to them: their coats.
- they're — they are: they're late.
Tests for each
they're — expand it to "they are". If that works, use the apostrophe.
their — it contains heir, and an heir owns something. Possession.
there — it contains here, and both are places.
The singular their
Their is also standard as a singular pronoun for a person whose gender is unknown or who uses it — "someone left their bag". That use goes back centuries and appears in Shakespeare and Austen; the objection to it is more recent than the usage.