As long as you use iCloud Photo Library to sync your images, they will disappear from one of the devices when you remove them from the other device.
To make sure they stay on one of the devices, you need to store them somewhere else. Get them to a hard drive, e.g., or an USB flash drive, or store them online. Google Photos can upload images from your iPhone automatically, Flickr can do the same, and if you keep them private, no one else but you will see them.
If you wish to stay with iCloud, use iCloud Photo Sharing. You can share the images with yourself, create albums, and they don’t count against your iCloud storage space. The same applies here, though: when you remove them from one device, they will also disappear from the other device.
iCloud Photo Library itself is not for storage, when it comes to photos. It just syncs them from one device to others.