Stop itunes library from syncing with iphone automatically
In iTunes, go to iTunes Menu > Preferences > click the "Devices Preferences" tab, and tick the "Prevent iPods, iPhones, and iPads from syncing automatically" 
box.



This will stop iTunes from opening automatically when you plug in your iPhone. 

You can also connect your iPhone to iTunes, stop the sync, click the iPhone icon in the upper left corner of the window, and in the "Options" section, untick "Automatically sync when this iPhone is connected".



This option prevents your specific phone from syncing automatically. You'll need to do both to get what you want accomplished.