When the harm of telling the truth is greater than the harm of the lie.
Of course, it is often difficult to calculate the ultimate harm of either lie or truth, and young children are particularly bad at these calculations because they don’t have much experience in predicting the future consequences of any action. Thus we tell children to tell the truth all the time, because parents can then help them make more accurate predictions about the effect of their actions.
But once you’re on your own, you’re on your own, and responsible for balancing the harms of truth and lie, using your best estimate of what could happen in the future.
The problem with lying to parents, is that if you get caught, that could have much more serious consequences than from lying to a court, for example. You have a family relationship with parents, and if you break those ties, you lose a lot more than if you get thrown in jail, in many cases. You might lose a whole community if you hurt your parents enough.
Of course, if your parents are a liability, then it is probably pretty easy to decide to lie.
Anyway, that’s the best formula I can give you. I can’t tell you anything about specific circumstances because I don’t know your circumstances. Also, the formula is applied to constantly changing conditions, and thus the output of the formula will always be different, even in slightly different situations.