For the Di2 cable section that runs through the drive side chainstay, use the preinstalled tube guide that is supplied with the frame.
Use the proper cable stopper or grommet to fi x the rear derailler cable correctly depending if you use mechanical drive-train (1.11) or electronic shifting