Google specifically allows you to limit the number of pages that a visitor can see before subscribing (or logging in). Google calls this the "first click free" policy. Here is Google's help page about it:
If you offer subscription-based access to your website content, or if users must register to access your content, then search engines cannot access some of your site's most relevant, valuable content.
Implementing Google's First Click Free (FCF) for your content allows you to include your restricted content in Google's main search index. Our intention is to protect your content while allowing for its inclusion in Google's search index. First Click Free has two main goals:
- To include high-quality content in Google's search index, providing a better experience for Google users who may not have known that content existed.
- To provide a promotion and discovery opportunity for webmasters of sites with restricted content.
In order to successfully crawl your site, Google needs to be able to crawl your content without filling out a registration form. The easiest way to do this is to configure your webservers not to serve the registration page to our crawlers (when the user-agent is "Googlebot") so that Googlebot can crawl these pages successfully. You can choose to allow Googlebot access to some restricted pages but not others. More information about technical requirements.