After a brief study, it appears that translators are unsure how to translate this phrase. The NET bible translation notes say "Heb 'according to his heart.' The idiomatic expression means to be like-minded with another, as its use in 1 Sam 14:7 indicates." But then, ironically, it translates it as "loyalty" in the text? Well, one can be loyal to someone, and not be like that person at the same time. Joab was loyal to David doesn't mean Joab was anything like David in character.
So does it mean someone who has a similar heart as God's, or someone who is simply loyal to God, or someone who is pleasing to God, or somethings else? Though those all tangentially relate, they are fairly divergent translations and I'm getting suspicious that because it is idiomatic, we've lost the precise meaning. What do you think?
a man who is dear to his heart. (1 Sam. 13:14 NIRV)
a man who is loyal to him (1 Sam. 13:14 NET)
a man who is pleasing to him in every way (1 Sam. 13:14 BBE)