Unless your iPhone is jailbroken, its impossible for someone to install spyware on it.
If it was jailbroken you would know it, so is it?
Press the home button to exit out of any open apps and go to the home screen. Slide all the way to the left to access the Spotlight Search page.If you see the Cydia app in Spotlight you have a jailbroken device. Ifthere is no Cydia app shown, your device is not jailbroken.
If you don't see that, and it's not jailbroken, there is no way you are being tracked. At the most he could have location sharing enabled between you, which you can see by looking at your settings for him in the Messaging app
Still with me?
Did that work for you? If so, please come back to the site and RATE my answer so that we can close out the question.
If it didn't please let me know so we can continue!