After consulting the books, here's my attempt at making things easier to understand.
First of all, I totally agree with Biluś - with those endings (końcowki) you don't have much of a choice, with or without further explanations about grammar. You learn them by heart, and after a while you'll forget all about the ordeal you've gone through. In this way, you will be able to recognize the Instrumental case, and all the others, just by taking a look at the ending. However, if you want to build up your own sentences and are not sure when and how to use it, maybe this will help:
One of the main constructions requiring Narzędnik (Instrumental) has the following structure:
Kto jest kim
Co jest czym
(Subject) jest (predicative)
In Polish, the subject (kto / co) is in Mianownik (Nominative), whereas the predicative (kim / czym) is in Narzędnik. Let's take a look at your examples:
Marek i Piotr są studentami Politechniki.
- Marek i Piotr: Subject (Mianownik / Nominative)
- studentami: predicative (Narzędnik / Instrumental) - this gives us further information on the subject of the sentence, and it follows the pattern (subject) są (predicative)
- On jest Francuzem / lekarzem / studentem.
Kto to jest? and your answer will be "On" (Mianownik)
Kim on jest? - this gives you further information about profession, nationality etc. and your answer will be a noun in Narzędnik.
It may be that the noun is determined by an adjective - like in your example: Oni są dobrymi przyjaciółmi. In such a situation, the adjective will also be in Narzędnik. You have to pay attention to the fact that even if the cases are different, there is still agreement in gender and number. You can't say, for instance, *Oni są (plural) dobrym przyjacielem (singular).
Finally, some tips and tricks:
- look at the verb. Narzędnik mostly occurs after these verbs: być, bywać, zostać, stawać / stać się, okazać się, zrobić się.
- look at the subject of the sentence and then at the nouns or nouns + adjectives giving you further information about the subject. They will most likely be in Narzędnik. Note here that if you have just an adjective, without a noun, describing the subject, then you have full agreement - gender, number and case. There is a difference between Marek jest zdolny and Marek jest zdolnym studentem. And don't forget to ask the questions. In the first situation, the question will be Jaki jest Marek?, whereas in the second situation, the question will be Kim jest Marek? (On jest studentem - this is the essential information, and the adjective describing "studentem" will obviously be in Narzędnik).