Apple doesn't seem to have an official lemon limit but they replaced the top-case 5 times on my 2016 and then gave me a 2017 with the same specs (slightly faster processor), and it's already crapped out already although this time they managed to replace the key and fix it.