I’ve been looking at surplus military manuals from various time periods to give me the important information of where a formation commander would physically be during a battle.
Obviously, the answer is “it depends”. Especially at lower levels, the rule of thumb (at least according to American military manuals) is “behind the lead subunit, so you aren’t at the very tip, but can still control the march and battle”. Of course, what the lead subunit is depends on the formation and the circumstances. The manuals themselves do not give a set location for where the command post should be (for very good reasons of both safety and flexibility), and throughout decades of major updates and technological changes, are adamant that the commander personally move often to the best location, which is frequently not the main command post.
Thus this gives me a feel for writing. The nuts and bolts of every specific engagement matter less than general details like where the commander would (in-theory) be. There are exceptions to the norm, for better and worse, which many of the manuals cover to their credit. Naturally, these won’t stop me from putting commanders into very weird situations, because I like weird.
It also doesn’t hurt that I’ve seen in my numerous forays into bad fiction examples of rather dumb commander placement, on all extremes. Many of which are not justifiable in either a tactical or literary sense.
And of course, pre-mechanized command is an entirely different story.