I agree with Ernesto that this doesn't seem like something qRules could help with - but logically, couldn't you compare the max of the ID in the two libraries, and then increment the highest by 1?
That is, create a data connection to each library, and have two rules - one with a condition that max ID in Library 1 is higher than max ID in Library 2 - if that condition is true, you'd use the max from Library 1 + 1 for your new ID. If that condition is false (in other words, if max ID in Library 2 is higher than Library 1) you'd use the max from Library 2 +1.... make sense?
I have to add, just for the sake of completeness, that there are risks in this approach (getting a max and incrementing by 1) - even if you query the data sources right before you submit, there is always a non-zero chance you could have two forms with the same ID. qRules has a GenerateGuid command - if you used GUIDs, you could be confident of uniqueness and you wouldn't have to all this.