Play both ends (against the middle/center)

To scheme in a way that makes two sides fight against each other.

The man was trying to play both ends against the middle when he tried to negotiate with the two departments in his company.