The correct option is B He left the house this morning wearing nothing but a hat and shoes.
We use but as an alternative to except (for), apart from and bar to introduce the only thing or person that the main part of the sentence does not include. It is often used after words such as everyone, nobody, anything, anywhere, all, no, none, any, every.
But is used as a preposition when we put a noun or pronoun after it.
Option B is correct. It means that he left the house only in a hat and shoes. The preposition 'but' is followed by the noun phrase 'a hat and shoes'.
Options A, C and D are incorrect because they are not in sync with the actual meaning of the question.