Use the Optimized Storage option for your Photos in iCloud. That way only the smaller thumbnails are stored on your device and not the full resolution photos that would quickly eat up your device storage. Only the full resolution photo is then downloaded from iCloud when needed for printing or editing and will offload automatically when the storage space is needed. When viewing the photos on your device, it does not need the full resolution version of the photo, so it is not required to have the full size photo on your device just to view it.
Manage your photo and video storage - Apple Support
Just for a comparison, I have 3,000 photos on my iPhone that only uses 600MB of storage and in iCloud those same photos account for 5.8GB of storage. If I were to be running out of storage space on my iPhone, the amount of storage used by Photos would be even less. That is all handled automatically.