As sometimes happens with Trump, what he did was confusing enough that it's not a simple matter to tease out what was done and triumphantly describe it as "illegal". There's a difference between urging voters to vote twice, and urging voters to follow some (questionable, confusing, fraught with legal risk) process to follow-up on an advanced vote by showing up at a polling station on election day. The bad part is that if voters don't know enough to state their intentions ("I'm here to check on my ballot") and just try to vote again waiting for "the system" to catch them, their intentions will be in doubt. Really bad advice, but not necessarily encouragement to deliberately break the law.
"Trump's Twitter commentary is legally sound, but doesn't make much sense and is an ineffective way for voters to track their ballots, experts have told CNN. But his remarks contained so much misleading information about election procedures that they were quickly censored by Twitter, and prompted election officials from Michigan and North Carolina, among others, to remind citizens Thursday that voting twice is illegal and they could be prosecuted."