They are required by law to replace your item for 3 repeated repairs of the same issue under warranty, though technically apple care may not be a "warranty" by legal standards and this may only apply to the original warranty.
They're not required to replace it after 3 times. They should replace it after a reasonable number of repair attempts, but there's no specific number.
OP, at the beginning of your post you said it's been in for service 5 times to the Apple Store and been sent out twice for the same issue. Have all 7 repair attempts been for the same thing, or have there been multiple issues with it?