iCloud Photos is a synchronization service. Using iCloud ensures that the Library of pictures on all of the devices connected to your iCloud account will be exactly the same. If you add a picture to one device, it will appear on the others. If you delete a picture on your iPhone, it will be deleted at iCloud.com and on any other devices you have connected to that account.
So, no, you can't have pictures in your iPhone Photos Library that are not in your iCloud Photos Library.
One option is to use the Hidden Album, and hide the pictures that you don't want seen at iCloud, but this doesn't save space anywhere.
On the other hand, you can have pictures in your phone that are not in the Photos Library. You can have pictures in the Files app on your phone, and local Files documents don't get synced to iCloud Photos or iCloud Drive. You can "Share>Save to Files" some pictures, and then delete them in Photos. Be sure to make backups first!
If you use a Mac, then more options are available.