How is "works" is that as long as people who matter recognize your claim, your claim is good. There isn't some higher authority or higher power that follows a fixed set of rules. This is a violent and unpredictable world where might makes right. There is no democracy, no court of appeal, no supreme court, etc. A royal pardon is law not because of rules in place but because the king says so and the king's word is law. In the same way, Jon is King in the North not because he really "fulfilled" his oath in the Night's Watch, but because the North is in a shitty situation and he's the best option. The Stark name still means something, and a man willing to lead them to fight their enemies is still respected.
The oath of the Night's Watch was not written with the idea of people coming back from the dead. It's meant to be a permanent vow. Saying that he "fulfilled his oath" because of resurrection is honestly just a loophole, and one which only justifies it for himself on a personal level. But since he was Lord Commander, and since all his enemies on the Wall who would have challenged him for it have been hung, and since the land is in chaos and they need a leader to rally them, the majority will not be hung up by the fact that he took some vows or whatever.
Thanks for the explanation Duckroll.
Yep. All the details are irrelevant. You need enough of a claim and enough of an army and enough allies to make it stick. The details of lines of succession matter during times of peace, and even then they're only as good as your ability to hold on to it, which often takes a different set of skills than the ones needed in times of war.
edit - it amazes me that this far into the show people still try to pick this stuff apart, when the whole point of the second half of season one was that the "rules" really don't matter.
I only brought this up due to the near constant, "Jon is the legitimate heir" proclamation I'm seeing everywhere. I just wanted to know if that is actually a legit thing. I understand that this season tossed all of the legitimacy claims out the window. Dorne shouldn't be in the hands of Ellara, but it is. The North shouldn't have declared Jon as the King in The North, but rather bestowed Sansa with the title of Queen in the North. So forth and so on.