I understand your question however you may not like my answer. iCloud for Photos and iCloud Drive work the same way and that is that iCloud is a synch service and not an archiving service. In other words, data on your iPhone is also kept on iCloud for the purpose of synching the data to all your other devices signed on the same Apple ID. This also means that if you delete data (A photo or a file) on your iPhone then it also gets deleted on iCloud (and vice versa). You are not going to be able to use iCloud as an extension of storage capacity of your iPhone.
Third party apps, for example, Google Photos and Microsoft's OneDrive will accomplish what you are looking for. These apps will allow you to offload data from your iPhone and store it on their servers.
Axel F.