Organization relationships are "company-wide" and only apply when sharing between two organizations using Exchange Online, or Exchange on-premises. Well, you can scope them down to a group, but in your scenario, sharing policies are a better option.
Create a sharing policy with the domains in #1, and another sharing policy with the domains in #2. For both policies, remove the "sharing with everyone" rule, and optionally, the Anonymous one (this is for Calendar "publishing"). Then, assign the policies to the relevant set of users. The users who would be allowed to share only with domains in #2 get policy #2 assigned, and so on.