There is no explicit declaration in the text of our Constitution that provides immunity to the president while in office for crimes that he or she commits. In addition, while the text of the Constitution is silent on presidential immunity, it is explicit on congressional immunity. No member of Congress may be prosecuted for what is said during speech and debate.
Plainly, the Framers knew how to provide for immunity when they wanted to — so their failure to do so for the president strongly implies that they didn’t believe it was appropriate in that case.
The closest the Constitution comes to addressing the matter is Article I, Section 3, which provides that after impeachment and removal from office, an individual “shall nevertheless be liable and subject to indictment, trial, judgment and punishment, according to law.”
This provision does not imply that prosecution takes place only when a president is out of office; it is simply intended to show that impeachment is not the only remedy for presidential crimes.