Syncing photos to iCloud and deleting them
iCloud is a syncing system and not a just a backup. 

If you delete the pictures on your iPhone (assuming you're logged into the same iCloud account) you're also deleting the pictures in iCloud. This is not what you want to do. 

Find a backup solution to keep your photos like Dropbox or Amazon Photos. Those will allow you upload your images without keeping them on your other devices.