How are hub dynamo lights wired and why does a rear light cause the front to come on?
Shimano hub generators have an electrically connected axle (stupid but fact, it comes from the time when bicycle lights were connected unreliably using a single cable closing the circuit using the frame). Even modern rear lights have this electrical frame connection, too (B&amp;M Cyo is clean in that matter). This means your circuit is built of two cables and one frame ... which may cause interesting effects.

Make sure that the marked cable (on cable pairs one is usually marked with a white line) connects to the connector marked with the ground symbol ON EVERY COMPONENT (generator, front and rear light).

Another solution is opening the rear light and cut the electrical connection of the screws used to mount the light. This voids warranty but you do not need to pay attention on cable ordering no longer.