For who knows whether he will be a wise man or a fool?
"For no one knows whether he will be a wise man or a fool."
he will be
The word "he" refers to the author's heir.
under the sun
"on the earth"
that my labor and wisdom have built
"that I worked very hard and wisely to build"