You will need the Reporting permission to access the people query builder.
The people query builder is the main tool for ad-hoc reporting of people data. It has a variety of additional uses such as:
Generating address labels
Mass change for people records
Printing giving statements based on query results
Printable built-in reports
Mapping addresses on a map
Creating charts and graphs of your data
You can access the query builder by clicking on "Reporting > Query Builder" in the left-hand navigation menu. The query builder defaults to People but can also be used to query group and contribution data.
The people query builder is organized into four main sections: Filters, Query, Columns, and Results.
There are multiple ways to write the same query (i.e. returning the same results). If you have difficulty coming up with the query you are looking for, try looking at it a different way.
AND operators has higher precedence than OR operators. Think of OR as splitting your query into pieces at that point. Any one piece being true will return that person profile.