Here "heart" represents Yahweh's desire or will. The phrase "man after his own heart" is an idiom that means to be a person who does what Yahweh desires. Alternate translation: "a man who is the kind of person he wants" or "a man who will obey him" (See: [[rc://en/ta/man/jit/figs-metonymy]] and [[rc://en/ta/man/jit/figs-idiom]])