Denote the six people by 1, 2, 3, 4, 5, and 6, in order of their heights and with 1 the shortest and 6 the tallest.
1 must be the leftmost of the first row. 6 must be the rightmost of the second row. Let us now place the 2. There are only two positions for him:
_ _ 6
1 2 _
or
2 _ 6
1 _ _
In the first case, there are 3 possibilities:
4 5 6
1 2 3
or
3 5 6
1 2 4
or
3 4 6
1 2 5
In the second case, there are 2 possibilities:
2 4 6
1 3 5
or
2 5 6
1 3 4
Thus the total number of possibilities is 5.