Alright, let’s tackle this. Westeros (including Targs and Starks) is quite obviously ruled by male primogeniture. This means, that for the Targs (and the Starks), the line of succession goes through the monarch’s eldest son and his line.
This means that Aerys -> Rhaegar -> Jon. Dany only THINKS she’s the lawful…