The conversation beneath your answer is getting a little long, so let me add something here:
"There were people there. People were nice." - is not grammatical.
True, because you've already mentioned the people. You need to say, "The people were nice", meaning, "The people [in that location] were nice."
"I entered the police station. The officers were looking at me" = those who were at the room I entered, not all over the building, were looking it me?
Yes, of course, it means the officers in the room – not every officer in the squadron, or every officer in the city, or every officer on duty that day.
"I entered the classroom during the lesson. Students were paying attention."
The first sentence gives enough information that there must be students there. And then I introduce them in the second sentence. Is it correct usage? What will be the difference from saying "the students"?
It's correct either way, although leaving the article out is usually interpreted as:
[Some] students were paying attention (i.e., most, or all, or half, or a few)
whereas when you say "the students," it's generally assumed:
[All or most] students were paying attention (i.e., most, or all, or half, if not a bit more than half)
That is, as a group, the students were paying attention.
can "the students", "the officers", if there are more of them who were paying attention/looking at me than those who didn't do that in a place, mean "most of them", so there can be some exceptions?
Absolutely! Now you're getting it!
I walked into the library. The people were looking at me.
Indicates that a lot of the people were looking at you. Maybe all of them, but, then again, maybe there's one sullen teenager in the corner who can't pry his eyes out of his sci-fi book, or one librarian who is too busy shelving books to notice you. If you really want to emphasize that every set of eyes was on you, you can say:
I walked into the library. All the people were looking at me.
or:
I walked into the library. Everyone was looking at me.
Even in that last case, though, we need to leave room for hyperbole. For example:
Everyone was drunk at the bar.
is often uttered, when what the native speaker really means is:
A lot of people were drunk at the bar.