`元首` is a highly formal term and its use is almost exclusively reserved for specific, high-level contexts.
News, Media, and Diplomacy: This is the most common place you'll encounter `元首`. News reports on international summits, state visits, or treaties will frequently refer to the leaders involved as `两国元首` (the two countries' heads of state). This is standard, professional language.
Formal Documents: Legal texts, official government announcements, and academic papers on political science use `元首` as the standard technical term.
Historical References: When discussing historical figures like kings, queens, or emperors from any country, `元首` is an appropriate and common term to describe their role.
Important Note: You would almost never use this term in casual conversation. To talk about the US President with a friend, you would say `美国总统 (Měiguó zǒngtǒng)`, not `美国元首 (Měiguó yuánshǒu)`, which would sound unnaturally stiff and formal.