We have a lot of folks here who can do a better job explaining infantry formations, but here goes ...
I can't speak directly to the Wilderness, but typically regiments (comprising the usual ten companies) fought in a double line with half their fighting men in the front rank and the other half close behind them in a rear rank. My rule of thumb is 22 inches of width to each enlisted man, so that a regiment with a strength of 300 enlisted men (officers don't count in this calculation) would occupy a front of 275 feet as an approximation. This formation delivers optimal firepower. The ten companies would not stacked one behind the other because then the nine companies directly behind the front company could not fire their weapons without endangering their comrades. Sometimes regiments are stacked up one behind the other (creating a "column of regiments") for ease of movement, but for the same reason it is a very ineffective formation for battle. During an actual battle, regiments do sometimes find themselves blocked by other friendly regiments positioned in front of them, and the results are never good.
At the outset of the war, the senior captain in the regiment commanded Company A, and the next senior captain commanded Company B, so that placing Company A on the far right and Company B on the far left ensured your most senior captains would be on the vulnerable flanks, and those two companies were often selected as skirmish companies, meaning they were deployed at a distance in front to cover the entire front of the regiment.