1) a ten years old boy is sitting on the couch.
2) a ten year old boy is sitting on the couch.
3) a ten-years old boy is sitting on the couch.
4) a ten-year old boy is sitting on the couch.
Which is correct?
Generally, when units of measure are used as adjectives, or as part of a compound noun, they are singular. When expressed as simple nouns, they are plural. Thus,
A ten-year-old boy is sitting on the couch.
The boy sitting on the couch is ten years old.
The boy sitting on the couch is a ten-year-old.
As for the hyphenation, exact usage is a matter of style, but the hyphen will determine how to interpret the phrase.
Ten year-old trees
refers to ten trees which are each one year old, whereas
Ten-year-old trees
refers to some trees which are each ten years old.
X year old is a phrase that can be either an adjective, noun or a construct of the verb to be
When used as an adjective the correct thing to say is year old.
A ten-year-old boy is sitting on the couch.
When used as a verb construct it must agree with the noun in terms of quantity.
The boy is sitting on the couch is 10 years old.
You want to use it as an adjective in your sentences so the number 4 is correct.
A ten-year-old boy is sitting on the couch.
The boy sitting on the couch is 10 years old.
Note, in this case, you can omit the part "years old" :
He is 10. = He is 10 years old.