For the US, there is actually a fairly standardized answer, though it's complicated. The short version appears to be:
Postdocs who teach count as 1/3 of a staff member. Postdocs who do not teach are not counted at all.
First, note that the number usually used in the US is student-faculty ratio. (Not "staff": in US academic parlance, "staff" typically refers to non-academic university employees: administrative assistants, accountants, gardeners, cooks, etc.)
We can pretty quickly eliminate the possibility of postdocs being counted as students - I've never heard of postdocs being considered students anywhere in US academia. They don't enroll in classes nor work towards a degree. (Even for PhD students working exclusively on research enroll in classes each term until they graduate, typically a 12-credit course called "Independent Research" or something similar. Postdocs do not.)
So, are they counted as faculty?
There is an organization called the Common Data Set Initiative which sets forth standard definitions for university statistics like student-faculty ratio. CDS doesn't actually gather data or publish survey instruments, but their set of standards and definitions is written in questionnaire form.
Item I-2, "Student to Faculty Ratio", says:
Report the Fall 2014 ratio of full-time equivalent students (full-time plus 1/3 part-time) to full-time equivalent instructional faculty (full-time plus 1/3 part-time). In the ratio calculations, exclude both faculty and students in stand-alone graduate or professional programs such as medicine, law, veterinary, dentistry, social work, business, or public health in which faculty teach virtually only graduate-level students. Do not count undergraduate or graduate student teaching assistants as faculty.
For the definition of "instructional faculty", we refer to Item I-1, which has a table explaining how various types of faculty members should be counted. For
instructional faculty in preclinical and clinical medicine, faculty who are not paid (e.g., those who donate their services or are in the military), or research-only faculty, post-doctoral fellows, or pre-doctoral fellows
it says they should not count as full-time instructional faculty, and should be counted as part-time instructional faculty "only if they teach one or more non-clinical credit courses".
So this is the answer. A postdoc or other researcher who does not teach any non-clinical credit-bearing courses should not be counted in the student-faculty ratio. A postdoc who does teach at least one such course should be counted a part-time instructional faculty member, and contribute 1/3 of a person to the denominator of the ratio.
Of course, it should be kept in mind that this data is provided voluntarily by each institution, and it is ultimately up to the institution to decide how they classify each of their employees.
With regard to rankings, the best-known rankings in the US are the US News & World Report Best Colleges Rankings. They explain that they generally follow the CDS definitions when collecting data from institutions.