It becomes criminal when you lie under oath. Sadly, that doesn’t always lead to a just outcome.
It’s criminal to lie, even if not under oath, if the lie is material to the investigation. That’s what got scooter Libby in hot water.