The first sentence is not wrong exactly but would sound better with contractions: Also, the way this sentence is constructed between British English and American English looks a little bit different. This is maybe why you think it is wrong:
He hasn't got married for the last two years would be perfectly fine in British English. Some people prefer to say "in" the last two years.