Generally, the major railroads TRY to have the second unit facing the same direction as the lead unit, i.e. "elephant style". That way, if the lead unit hits something, the lead unit can be cut off, and the second unit has the cab in the lead position. The last trailing unit generally has the cab facing rearward, so the unit consist doesn't have to be turned at the end of the run.
Obviously, things don't always work out this way, but they try. There is method to the madness.