# that he might fulfill
The word "he" refers to King Solomon.
# the word of Yahweh
"the things that Yahweh had said"
# which he had spoken
The word "he" refers to Yahweh.