师兄 Elder brother of the school. The Handian dictionary defines it as a person who began to study under the same master before oneself. 师姐 is the elder sister of the school. 师弟 and 师妹 are the younger brother and sister.
The rank follows who began first.