1 It is the school.I visited the school two years ago (第二句中,school作宾语) 把它们合并起来:
Iti is the school that / which (=the school) I visited two years ago.
2 This is the school.I studied in the school two years ago (第二句中in the school作地点状语)把它们合并起来:This is the school where (=in the school) I studied two years ago.
明白了吗?