The best place to look for the answer to your question is the end of Act 5 when Fortinbras shows up at the Danish court at Elsinore. When he walks in the door he sees the most shocking and awful scene: four dead bodies, and three of them are the only surviving members of the royal family! First and foremost, Fortinbras becomes the king because HE is royalty and "has some rights of memory here" because his father once held lands that were later taken over by the Danes, but that now seem to have reverted to Norway. The second reason he is king because it is Hamlet's dying words that he should be. Hamlet tells Horatio that he, Horatio, must live on to explain "to the yet unknowing world" what happened here. After that, Hamlet specifically says that he "sets his election lights on Fortinbras" meaning that he gives his dying recommendation that Fortinbras should be the next king. If you think about the fact that the death of Claudius means that Hamlet is king, if only for a few minutes, then these final words are the words of king passing his crown on to his heir. Hamlet expresses in Act 4 some admiration for Fortinbras and his ambitions to fight the Poles for land that only had value "in its name." He also calls Fortinbras "a tender and gentle prince." He sees and admires the mix of ambition and leadership that could make him a fine king one day. Sometimes readers wonder why Horatio wouldn't be made king, but the fact is, Horatio is not royalty, and therefore would have no connection to the throne. Denmark in the time of the play is an elected monarchy, but Horatio is only a school friend of Hamlet's, and while he is an admirable guy, he is not true king material.