God picked him out to be the leader of the Israelites when he was just a teen-aged shepherd boy. He went from shepherd to king. However, he wasn't without fault when he lusted after Bathesheba and had her husband killed in battle (their firstborn child was stillborn - God took the child away as David's punishment).