According to Shimano XT website the Chainline for the current triple is 50mm whereas for the double crank it is 48.8mm.
I assume that this is a measurement from the centreline of the BB shell to a notional centre of the rings (so on a triple it would be where the middle ring lies, on a double I imagine a line between the two rings)?
Just had a look at Sheldon Brown and my assumptions are correct. However it looks to be a minefield depending on frame type and crank being used.
You say it either rubs on cage or drops off rings. On which side (ie rubbing on Large ring/dropping off little)? I’m not being condescending or don’t mean to be. Have you adjusted the end stop screws? Is the outer mech plate as close as possible to the large ring (1-2mm I think is recommended).