First, use a Constituent Giving Years smart query to tag records:
  1. Go to Administration>Smart Fields>Add a Constituent Revenue Giving Years smart field
  2. Name your smart field on the General tab
  3. On the Parameters tab, choose Value to return: distinct giving years, specify your date range, and select Revenue Type: Membership (here you can also choose Donation and then choose a designation if your past membership revenue was tied to a specific designation)
  4. Save and process the smart field
Then, build a new Constituent query with the following filters:
Member/Membership/Status is equal to Active
AND Smart Field/[Your Smart Field Name]/Value is greater than or equal to [the number of years they have to have been a member to qualify]