If you are using iCloud Photos, all photos in iCloud Photos will sync to all participating devices. You can enable settings like "Optimize iPhone Storage", but there is no way of selectively synchronizing photos that are within iCloud Photos.
You can store some of the photos on your Mac outside of the iCloud Photos system, e.g.,
- Loose in the Finder,
- In a third-party organizer such as Adobe Lightroom, or
- In Photos libraries that are not connected to iCloud Photos
You can have multiple Photos Libraries on a Mac. At most one of them (the system library) can sync with iCloud Photos. The others are strictly local. To create or switch between libraries, hold down the Option key when you launch Photos.
Unfortunately, while you can have multiple Photos libraries, Apple doesn't provide any convenient way to open up two, simultaneously, so that you can easily move photos between them.