Diplomatic victory - winning the diplo victory election.
Two leaders will run for the election - the leader with the most population, and the leader who builds the UN. If you are both, the second most populated civ will run too.
The election will be voted on by all other civs. I don't know why some civs will abstain. However, basically you need a higher diplomatic rating with other civs than your candidate.
For example:
You are HC, and you built the UN. You are guaranteed a spot in the election. Cyrus has the most populated civ, so he will be the other candidate.
Leader / their rating of you / their rating of Cyrus
Monty / +6 / -4
Louis / +9 / +7
Elizabeth / +2 / +4
Frederick / -1 / -3
Since I don't know the basis for abstaining, we will assume none abstain. Monty, Louis, and Frederick will all vote for you. Elizabeth will vote for Cyrus.
Again, the number of votes you will get depends on each civ, and you need to be the leading candidate AND have the minimum number of votes to win.
Assume these figures - I don't know if they'd be accurate, but they're for hypothetical purposes.
Leader / Population / votes contributed
Monty / 3,000,000 / 300 (votes for you)
Louis / 3,000,000 / 300 (votes for you)
Elizabeth / 5,000,000 / 500 (votes for Cyrus)
Frederick / 1,000,000 / 100 (votes for you)
You / 5,000,000 / 500 (votes for you)
Cyrus / 6,000,000 / 600 (votes for himself)
The minimum amount of votes for victory is 1,000 votes.
In total, you got 1,200 votes. Cyrus got 1,100 in total.
So, even though both you and Cyrus got the minimum required amount, you had more than him - thus, you win.
Someone please correct me if I'm wrong, this is how I understood it.