My principle - home and superior (Q-wise), or away and much superior, play an attacking formation; otherwise defensive.
Although it can be over-ridden if I can see a history of the opposition overcoming superior opponents, then I play defensive.
I think in general, the more players nearer your goal than the opponents, the more defensive the formation.