Older is the general comparative and works for anything. Elder is restricted to people — usually family members and seniority — and crucially cannot be followed by "than". So: "my elder brother" but "he is older than me", never "elder than me".
The core difference
One is general; the other is restricted in both scope and grammar.
- older — general: an older building, older than me.
- elder — of people, typically family or seniority: my elder sister, the elder statesman.
The grammatical restriction
Elder cannot take than. "She is elder than me" is not English; it must be older. Elder works attributively, before the noun, or as a noun itself — respect your elders.
Eldest and oldest
Eldest follows the same restriction: the eldest child, but the oldest tree. And elder as a standalone noun means a senior member of a community, which older never does.