Yahweh uses a question to emphasize that David is not the one to build a house for Yahweh. This question can be translated as a statement. Alternate translation: "You will not build a house for me" (See: [[rc://en/ta/man/jit/figs-rquestion]])
Here the word "house" means a temple. Later Yahweh will say that he will build a house for David, but there the word "house" means a family. If your language has a word that can express both ideas, use it here.