The king of the Israelites when David was a boy was King Saul.
Saul was the first king of Israel, chosen by God, and he ruled during David's youth. David eventually became king after Saul's death, but their relationship was complex and often fraught with tension.