There is not election of a Prime Minister as such. Each political party selects its own party leader. At the general election, the nation vote for a political party for their local area, this is called a local MP (member of parliament). The party with the most MPs in the House of Commons, becomes the governing party and their leader becomes the Prime Minister. If the Prime Minister stands down during his/her term in office, an election for a new party leader takes place - this vote is not from the general public.
I hope that is what you were looking for.