Jon wouldn't be a legitimate, true-born Targaryen heir. Bran is the legitimate heir to Winterfell.
If Rhaegar and Lyanna got married prior to his birth he would be. There's precedent for Targaryens taking multiple wives, so it's not out of the realm of possibility.
Wouldn't that wedding have to have been public for it to count?