I have 6 phones under the same Apple id. I would like the photos on all phones to backup to the cloud, but not be shared between all devices. How do I do that?
You can't do it permanently.
iCloud is a syncing system and not (primarily) a backup system. It's main goal is to allow you to share your photos and documents between all devices signed-in with the same Apple ID.
You can either not sign-in to a device with the same Apple ID, create a new, different Apple ID for the device you don't want your photos (which create problems if you do want to share other documents), or not use iCloud for your photos.
Turning off my photo stream in photos settings can do this but only for 30 days.