"He was my student."
Translation:Er war mein Student.
Yes, but when you are in an university you are no longer a "Schüler", instead you are title as a "Student".
I think -em for masculine is used when prior to it a preposition is used. for example: Ich fahre mit meinem Auto. But I could still be wrong.
I found the solution, He and the student are both pointing to the same 'item' (which is the subject) in this sentence, therefore they should both be in first case. HeavenlyYaksha, about your example, there are indeed certain prepositions that need a certain case. However, in this situation, none of them are used.