SeaSnake
OG
As a member of the House of Baratheon, Stannis is the de facto most legitimate ruler due to be the benjamin brother of the king the Seven Realms of Westeros choose to let rule over the kingdom.
But customarily speaking, the Baratheons's claims of birthright over the Iron Throne are notting down below in contrast to those of Daenerys Targaryen, a pure-blooded princess and daughter of a king (the Baratheons only had a bastard forefather and presumed half-brother to Aegon Targaryen The Great from about 300 years ago, and a full-blooded Targaryen great-grandmother to justify their legitimacy. Daenerys is almost virtually pure-blooded from BOTH sides of the family due to her both parents and grandparents being siblings as wishes the rules of royal incest within their House) besides being most above all and far potentially the messianic Azor Hai they long waited for his return. As much having the real-life Windsors of the United Kingdom claiming birthright over the former possessions of French royalty due to their remote Plantagenet blood when the House of D'Anjou-Savoy is still around. And if ever the ASOIAF novels will confirms someday what the show revealed years ago, even Jon Snow had more legitimacy than the whole of the House of Baratheon due to his natural paternal lineage ajd him being as well as Daenerys one of the most eligible presumed Azor Hai, given how far his exploits and the circumstances around his birth coincides with the prophecy too and that he is suspected in the novels from having noble Southerner blood related to one noble house distantly related to the first Azor Hai from 18,000-12,000 years ago-- and thus... potentially to the Targaryens, who are implied to be too the direct descendants of this legendary god-emperor.
From a matter of bloodline degree, the Baratheons are almost of equal worth with the House Martell of Dorne and their Sand bastards.
Targs tho were foreigners and the Dornish are so far south. House Baratheon is too powerful. But Stannis probably wouldn’t be considered legit because of his religion.