Commas before that [closed]
Yes, the second comma is valid. But it's only valid because it's required by the parenthetical (i.e. "or thought he'd known") and therefore not really related to the fact that you used the word "that." If you omitted the parenthetical, the comma would not be valid; you would say:
But surely he had known that Santa wasn't real.
Including this comma here would not be valid:
But surely he had known, that Santa wasn't real.
It is valid to use commas to set off essential and nonessential expressions, that otherwise interrupt the flow of thought, and to also separate important elements:
But surely he had known, or thought he'd known, that Santa wasn't real.
It is also valid (but generally considered lazy if overused) to use parentheses to set off nonessential expressions that could also otherwise be left independent of the main thought of the sentence:
But surely he had known (or thought he'd known) that Santa wasn't real.
For special emphasis, the em-dash can also be used, and can also serve as a valid alternative to other marks—such as the comma and parentheses—as long as it is used sparingly. Like the parentheses, it can set off nonessential elements; but it does one thing more that the parentheses cannot—it can set off essential elements as well.
But surely he had known—or thought he'd known—that Santa wasn't real.
For the most part, you would use the comma in this case. The comma is discreet, and if the point you want to make is that he is uncertain of what he thought he knew, then you might consider pointing it out with a parentheses (if you consider the information nonessential) or the em-dash (if you consider the information essential).
Yes, the comma is used well.
One "rule" for using commas goes something like this: set off interrupting information with commas.