Cinder it is all really simple.
First, remember that all 50 states, Washington DC, and the US territories all have their own version of how to do this. So, begin by memorizing all the bylaws in all 50+ areas. For starters, is it a caucus, a primary, or a convention? Then is it winner take all or is it divided? If it is divided is it by popular vote in the state or by popular vote in each region within the state*? Are there bonuses (Republicans) or are there superdelegates (Democrats)? Are the delegates proportional to the size of the state, to the size of the voters in the state, to the size of the party within the state, or some other arbitrary rule? Does this state have penalties for voting for the wrong party in past local, state, and national elections? Does this state have penalties for violating the party rules? Answer each of those questions for each state and territory as they all will vary in each of those points. So, memorize ~55 different sets of rules. Oh and double that because what they do for the democrat side is not what they do for the republican side. And that doesn't even include the 3rd party candidates.
* For clarity, suppose your region is 51% for candidate X and 49% for candidate Y and that your region gets 5 delegates. Clearly the fairest way to divide these delegates is for X to get 3 delegates and Y to get 2 delegates. The person with the most votes got more delegates. But, now suppose your region is 57% for candidate X, 43% for candidate Y, and that your region gets 4 delegates. Do you give each 2 delegates (50/50 split) or do you give one candidate 3 and the other candidate 1 (75/25) split? Clearly since 50/50 is closer to the actual vote of 57/43, you give each candidate 2 delegates. So even though in this case one candidate had a substantial win, each candidate gets the same number of delegates.
Then realize that you aren't even voting for the presidential candidates. You are voting for people who will vote for the presidential candidates. Sounds fine and dandy if they vote the way you want them to vote. But there isn't anything binding. There are ~26 delegates that were supposed to vote for Edwards. But Edwards isn't in the running. So who do these 26 delegates vote for? That is anyone's guess.
Also, realize that the votes in the primary, caucus, or convention might not actually be related to the delegates at all. Take Iowa for example. The people voted too early for the democrat and republican party laws. But, no fear there is a solution to that, simply have the Iowa delgates selected far after the popular vote in a mannor that is only indirectly related to how the people actually voted. That way, the delegate selection is done in the proper time period and the delegates also count.
Finally, once the delegates vote, there might not be a clear winner. In which case, each party has their own complicated list of proceedures which essentially is a free-for-all and the popular vote is meaningless at that stage.
Oh and remember, these rules change approximately yearly, so you must relearn this for each election.
As you can see, even a 10 year old could easilly figure this all out. We could have a simple national poll where the person with the most votes is the nominee, but since our current system is so simple, why change it?