A: Are you a visiter or a student ?
B: I'm a student in this school. 저는 이 학교(에 다니는) 학생입니다.
For B, ' a student in this school' is the important message to convey.
In this case , B should use '는' /'은' not '가'/'이'.
A : Who did brake the window ? 창문을 누가 깼니?
B : Sorry, I did it. 미안해요, 내가 그랬어요.
In this scene , key word is ' who'.
and B said I (did).
If the subject is focused, you can use '가'/'이'.
ex) A: How about some fruits? B: 나는 과일을 좋아해요. ( key word : 좋아해요 )
A: Who would come to pick up the baby? B: 그 아이 아빠가 온대.(key word : 그 아이 아빠)
Then, some teachers call '가' / '이' as ' subject maker' and '은'/'는' as 'topic maker'.
I told the basic difference between '가' / '이' and '은'/'는' .It's very important for a Korean-learning-beginner.
But.... this is just a case.
There are so many cases using each words.
I am poor at English. Sorry.
But, I hope this answer helps you.