Well for one, the basic flow of an HTML document might look like:
<!DOCTYPE html ... >
<html>
<head>
<link>
<meta>
</head>
<body>
<!-- Just making up some placeholders... -->
<p></p>
<div></div>
</body>
</html>
. Yours, on the other hand, has multiple <html> and <body> tags that overlap, some random data at the end, and I didn't even bother trying to run it through a validator because there's no point in doing so until the code is cleaned up a bit.
It looks like you first need to figure out what's duplicating some of the HTML. Then you need to re-arrange some of the HTML so that there isn't random chunks thrown at the end after the </html> (which does what it looks like - signifies the end of the HTML document).