Hi:)
For casual, you use it to people who are younger than(younger siblings, friends who are younger than you) you or same age as you. As for formal, you use it to people who are older than you(friends who are a few years older) or have a higher status than you(teacher, parent etc).
Hope it helps:)