The word "he" refers to King Solomon.
"the things that Yahweh had said"
The word "he" refers to Yahweh.