What you need to know is that iCloud Library is not an off-device backup storage facility. It's a syncing feature so that all devices signed into the same iCloud ID and use iCloud Photos will have the same photos in their library. Any operation on a device, i.e. addition or deletion (even if by accident) of a photo will be duplicated on all devices using that iCloud Library.
Any photo in the iCloud library is on each device. You could enable "Optimize Mac Storage" on your device so that when your device's storage reaches a certain level all new photos will be optimized, i.e. reduced in size, with the full sized version in the iCloud Library. If you want to use an optimized photo for any reason you will have to download the full sized original before it can be used.
If you want to backup your library you can do so to iCloud (on iPhones and iPads) or to a computer.
For iPhones and iPads there are portable devices which can connect to the iPhones/iPads and with the software included download photos and documents from your mobile device to the portable device. One such device is called ThePhotoStick.
Using such a device you can then delete the photos, after confirming a successful download, from your iPhone/iPad to free up space on it. BUT NOT WITH ICLOUD LIBRARY!