Hi! A principal is “a chief or head, particularly of a school.” "Principal" can also be used as an adjective meaning “first or highest in rank, importance, or value,” as in The principal objective of this article. "Headmaster" is a man heading the staff of a private school. "Schoolmaster" is simply a man who teaches children in a school. "Rector" is a senior official in an educational institution, and can refer to an official in either a university or a secondary school.
Hope this helps :)