This is known as dramaturgical theory.
Ervin Goffman, an American sociologist, wrote a lot of research of people and their interactions. He devised his theory which he called dramaturgical theory, where he used terms from the theater in order to describe people and their behaviors, especially in relation to other people around them.