Since it can become a bit of a pain to edit a project where things go off the grid (beyond “feel”), I tend to record everything to the metronome, and then work with the tempo track to implement tempo variations. That has the advantage that you can still use the metronome for further recording, including audio, which is particularly helpful when there isn’t much going on.
I don’t know about rules, as I just go by feel, though I guess there are probably some rules of thumb one could use as a starting point.
Obviously, you can’t make drastic tempo changes unless the arrangement makes it easy for the listener to follow, because then it’ll just sound like everything is thrown off when you get back in. So, basically, smooth changes rather than jumps, and the maximum feasible “rate of speed of change” depends on how much is going on.
There might be a bit of an exception for phrasing, like marking the end of each “section” in a waltz or similar, where you can slow down over the last few notes, then have more or less an extra pause, and then jump right back to the nominal tempo for the next section. It doesn’t have to be blatantly obvious to have the intended effect. On the contrary, it almost sounds like there is no deliberate tempo change when it’s just right, while it would actually sound weird if the tempo was constant.
Oh, and it might be an interesting exercise to import recordings of live concerts and draw a matching tempo track, to see exactly what that looks like in the DAW. Much like drawing expression automation curves; it’s a lot of trial-and-error initially, but you get the intended results much quicker once you start learning what things actually look like in that format.