No. If you could avoid prosecution by running for President, every criminal in the USA would announce his candidacy.
There is a rule that they won't indict a candidate for high office within 6 months of the election,, which would be after May, 2024. Lots of time to get them done.
In announcing his candidacy so early, Trump was hoping that what you posted is true and he could stave off indictment by just announcing, and as always, he shot himself in the foot, and likely sped up the filing of charges, to ensure that can get the trial done before the 6 month rule kicks in. If a Republican gets in other than Trump, he can get a pardon, maybe.
I wouldn't give him jack shit, but Republican voters would destroy the electee if he didn't pardon Trump.