Lamech is the eighth generation descendant of Seth (Genesis 5:25), the son of Methuselah and the father of Noah (Genesis 5:29), in the genealogy of Seth in Genesis 5. In Genesis 5:12-25, Lamech was a son of Methuselah who was a grandson of Jared who was a grandson of Kenan descended from Adam. In Genesis 4:17-18, Lamech was a son of Methushael who was a grandson of Irad who was a grandson of Cain son of Adam. The Lamech of Genesis 4 and the Lamech of Genesis 5 had ancestral lines with almost identical names plus other intervening ancestors.
Genesis 5:28-31 records that Lamech was 182 years old at the birth of Noah, and lived for another 595 years after this, placing Lamech's age at death at 777 years, just a few years before the Flood using the Masoretic chronology. With such numbers in this genealogical account, Adam was still alive for about the first 50 (56) years of Lamech's life.
Using the Septuagint (Lucianic) version of Genesis 5:28-31, Lamech was 188 at the birth of his son Noah and lived 565 more years. Lamech's age at death was 753.