1st gen: 2015 Macbook
2nd gen: 2016 Macbook Pro
3rd gen: 2017 Macbook Pro (Apple never acknowledged this, although there is slight change in key design, and some indications that it was also a mechanism redesign), same change for 2017 Macbook
4th gen: 2018 Macbook Pro (additional silicone barrier)
5th gen: 2019 Macbook Pro (dome redesign) - most probably the final redesign
2018-2019 are interchangeable, also 2016-2017. To 2018 keyboard feels more or less like 2019.