Not much info to work with, but here we go.
The solution is to use a separate relationship for each match criteria, then have a calc in the parent table check if only one of the relationships has related records. If so, it builds the key. This is then matched with the multi-line on the child side.
parent_xor_key (calculation, text result) = case(not isempty(rel by criteria1::recordID) xor not isempty(rel by criteria2::recordID); g_criteria1 & ¶ & g_criteria2 )
Just as a matter of interest - can you explain why you are trying to do this in this case? I don't see what the OR relationship will do for you.
What I can see is that it will show all data related to an item, and all the other items separately (but not items on not related items). Is that what you want?
If so, I would use two portals - one which showed all related items, another which showed all remaining items.
I'm not saying OR relationships are not needed, just asking what you are trying to do here.