身在曹营心在汉

身在曹營心在漢
shēnzài Cáoyíngxīnzài Hàn
  1. live in Cao camp but have the heart in Han camp (idiom)
  2. to be somewhere while longing to be somewhere else

CEDICT

subjugated by one authority, while still remaining loyal to another; not loyal

Wiktionary

Entry Composition