The switching valve is what is causing the rear tank to pump into the front tank.
I am trying to figure out why you are replacing the fuel lines?
Ford Dealerships most of the time have a kit to properly repair the fuel lines. Especially the plastic connectors. However, if the lines are leaking at a connection with the steel braided sections and the steel lines, replacment is really the only option.
You best bet would be a wrecking yard as buying the lines from Ford will be expensive and probably not available. Also from a wrecking yard, you will have a really good idea of how there are run.
Always keep in mind the pressures that these lines see. The fuel pump operates at 30 psi normally and can reach pressures over 70 psi. Not something that you want to take a chance with. Each tank has a high pressure fuel pump inside it. The selector switch changes which pump and sender is activated.
The switching valve (which is that black thing on the drivers side frame rail that has 6 fuel lines going to it) is the cause of the rear tank pumping into the front tank. This is pretty common on dual tank vehicles. Replacing the valve is the only fix.
One of the problems, and something that you have probably noticed, the fuel lines are pretty much one piece, except where there must be a connection. This is to limit the possibilities of leakage and missed connections during production.
Here is the only diagram that Ford gives for the fuel lines, I hope that it helps: