Presidents enjoy immunity for official acts but not unofficial acts. The government has to demonstrate that an act was unofficial - i.e., outside the president's job description
It leaves open the idea that something could be both official and unofficial, though, if it is (a) in the "outer perimeter of his official responsibility" and (b) "applying a criminal prohibition to that act would pose no dangers of intrusion on the authority and functions of the Executive Branch."