Just remember two facts. One, attacks are processed in the order in which they're set. Two, a unit cannot pass through another unit.
So, if you set a unit in the rear to attack over another one of your units, it will stop when it reaches it. Instead, set the front unit(s) first, then move back to the rear.