A principle for the three pawns in front of the castled king is that they should remain in their original positions. But, as you know there are exceptions to every pinciple or rule. Just as in mathematics there are no absolutes, and the exception proves the rule.
There is a general principle, but it applies to the entire board, not just the pawns in front of the castled king, over the entire game. This principle encompasses the exceptions to principle that the three pawns in fron of the castled king should remain in their original positions.
The principle is:
Winning chess is the strategically and tactically correct advance of the pawn mass.
If you would like to know the details of how this principle is applied with every move in a chess game you need to study endgames. You can begin with endgame material here on chess.com. But if you get serious about the game you will need Dolmatov's endgame data base and Yuri Averbach's endgame series.
For a more general treatise on pawns you will need, "Pawn Power In Chess ", by Hans Kmoch.
I know that when I move any of the three pawns in front of my castled King I compromise King safety. In comparing my moves with the computer I find that it wants me to move these pawns earlier and way more often than I do.
I don't necessarily know why the computer wants to make these rules. Does anyone else have the same problem? Can anyone give me a general principle to guide me in this decision?