In most European countries we don’t vote for prime minister/presidents.
The representatives from the parties are free to choose whoever they want, but generally it becomes a leader of the largest party in the governing party/coalition.
And Canada, the UK, Australia, New Zealand, ...
And Canada, the UK, Australia, New Zealand, ...