Let the number of students who are in the play be 'x'
Total number of students = 28
So number of students who are not in the play are 28 - x
The ratio of number of student in a play to the number of students not in the play = 2 : 5

Cross multiply
5x = 2(28 - x)
5x = 56 - 2x
Add + 2x on both sides, we get
5x + 2x = 56 - 2x + 2x
7x = 56
Divide both side by 7, to find x

x = 8
So number of students who are in the play = 8
And number of students who are not in the play = 28 - x = 28- 8 = 20