iCloud will manage the storage automatically, when you enable "Optimize iPhone Storage" for iCloud > Photos in the Settings.
This is fully automatic. iCloud will just optimize enough photos and remove the high resolution originals for photos you have not used in a long time to ensure you have enough free storage for your iPhone to work well. But it will keep the high resolution versions of your most recently photos on your device, so you do not have to download them again from iCloud when you need them. Just trust iCloud to ensure that you always will have enough free storage, even if Photos is keeping some items stored locally to avoid having to download recently used items again.
It is not possible to force photos to remove the local copies completely. But Photos will do it automatically, when you are running out of storage.
But you should not keep more photos in videos in iCloud then will fit onto your iPhone, at least optimized, roughly 10% to 20% of the storage they are using in iCloud. As an estimate - if your photos and videos are taking up 200 GB in iCloud, you the optimized versions will need at least 20GB locally on your iPhone.