As long as the external hard drive is connected to the Mac, iTunes will back up your data to your external hard drive rather than the internal hard drive. The backup will fail if the external hard drive is not connected to the Mac.