The rule that spanish uses to explain the difference between tú and usted is how close you are with the person, whether they are in the same age range as you, and if they are an authority figure. For an example, if you’re talking to a friend, you may use tú. If you’re talking to a teacher, you should use usted unless your teacher tells you not to because some are fine with being addressed as tú.