* You: This is a pronoun, not a noun.
* Hit: This is a verb.
* The: This is a definite article, not a noun.
* Nail: This is a noun.
* On: This is a preposition.
* The: This is a definite article, not a noun.
* Head: This is a noun.
Therefore, there are two nouns in the sentence: nail and head.