The sentences serve only as examples -- I want to learn the distinction between no and koto in such usage. I wanted them to mean `it was good that he went home' (now I see that at least one verb in them should be in past tense, but I don't know which ones.)
I saw ..no and ..koto both used to nounify a sentence expression and couldn't find any rationale as to when use which one. There were some topics in this forum where the difference was said to exist, but wasn't described.
Thanks
Koto and
no can most of the time be freely swapped without losing the meaning (I had better say that I do not remember any case that you couldn't use one of them and not the other one, so if someone comes with an example of no koto-no correspondence, feel free to correct me

).
So the example you give can possibly be rendered as either:
- Kare ga kaette itta koto ha yokatta desu [彼が帰っていったことはよかったです]; or
- Kare ga kaette itta no ha yokatta desu. [彼が帰っていったのはよかったです]
EDIT: Well, I remember now that there are some
conjunctions in Japanese which employ
koto only, and replacing it with
no would render the sentence ungrammatical.