When "It" as a subject represents a living being or a thing it's a notional subject, when it performs a purely grammatical function it's a formal object.
When a NS "It": 1) Denotes definite thing or an abstract idea (the personal "it") (Here's the door. It can be opened); 2) Points out some person or thing expressed by a predicative noun (the demonstrative "it") (It is Mary).
When a FO "It": 1) Denotes natural phenomena (weather, etc.) or characterizes the environment (It is raining) or denotes time and distance (It is nine already) (the impersonal "it"); 2) Introduces the real subject (the introductory or anticipatory "it") (It's no use crying); 3) Used for emphasis (the emphatic "it") (It was John who did it).
More tools for learning grammar.