If you turn on iCloud Photos on a device, the photos will sync to iCloud and to all other devices where you have iCloud Photos turned on. See the instructions in Set up and use iCloud Photos - Apple Support
Be aware that iCloud Photos is a syncing service. Any photo you delete from a device where iCloud Photos is turned on will also be deleted from iCloud and from any other device connected to iCloud Photos. You can potentially reduce the storage space required on a device by turning on Optimize Storage on any device where you want to reduce the storage required.
Apple does not currently offer cloud-only storage for photos. If that is what you want or need, you may want to explore 3rd party options such as Google Photos or Dropbox.