Number of ways to arrange n people of increasing height The task is to arrange $n$ people in a single line such that exactly $x$ of them are visible from left and $y$ of them visible from right (Since some taller people block the view of the shorter ones).
For example, if the people were arranged in line with heights 30 cm, 10 cm, 50 cm, 40 cm, and then 20 cm, someone looking from the left side would see 2 persons (30 and 50 cm) while someone looking from the right side would see 3 persons (20, 40 and 50 cm).
The answer lies to place the tallest person in such a way that the problem is divided into 2 halves, but I'am not sure how.
Edit : It is to note that all the heights are distinct

This is building on @Fimpellizieri's answer.  As @Fimpellizieri showed, we can reduce this to the problem of calculating $l(n,k)$, the number of ways of ordering $n$ people so that exactly $k$ are visible from the left.  (Note that $r(n,k) = l(n,k)$, since you can reverse to order to switch left-visibility into right-visibility.)
We claim that $l(n,k) = \left[ \begin{array}{c} n \\ k \end{array} \right]$, the Stirling number of the first kind.  $\left[ \begin{array}{c} n \\ k \end{array} \right]$ denotes the number of permutations of $n$ that, when written in cycle notation, have exactly $k$ cycles.
Now suppose we have a permutation of the $n$ people with exactly $k$ visible from the right.  Note that the $k$ visible people must be ordered in increasing order of height, with the last visible person being the tallest.  Also, this divides the $n$ people into $k$ ordered sets: the sets of people behind the $i$th visible person, for $1 \le i \le k$.
Hence we can biject these permutations to permutations with $k$ cycles - simply take these ordered sets to be the cycles of a permutation.  For the reverse map, given a $k$-cycle permutation, take the $k$ cycles (in their cyclic order) to be the $k$ sets, rotate the cycles so that the tallest person in the cycle is first (since this person should be visible, and none of the others in the set), and then order the cycles in increasing order of the height of their tallest people (so that each of these people is visible).
Hence we get $l(n,k) = \left[ \begin{array}{c} n \\ k \end{array} \right]$.  Unfortunately there is not a nice closed formula for this Stirling number, but there are recursive formulae that can be used to compute them quickly.

EDIT: An alternative approach.
While one can substitute the Stirling numbers into the summation formula given in @Fimpellizieri's answer, the bijective argument above can be extended to give a closed (up to the Stirling numbers) formula.
Indeed, suppose we have an ordering with $x$ people visible from the left and $y$ people visible from the right.  The tallest person is the last person visible from either side, and to the left there are $x-1$ people visible from the left, and to the right there are $y-1$ people visible from the right.
Hence after removing the tallest person, we can divide the $n-1$ remaining people into $(x-1) + (y-1)$ ordered sets: for each $1 \le i \le x-1$, the people behind the $i$th visible person from the left, and for each $1 \le j \le y-1$, the people in front of the $j$th visible person from the right.  As before, thinking of these ordered sets as cyclic permutations gives us a permutation of $n-1$ people with $x + y - 2$ cycles, with $x-1$ "left" cycles and $y-1$ "right" cycles.
Conversely, suppose we have a permutation of $n-1$ people (the tallest person has still been removed) with $x + y - 2$ cycles.  From these cycles, choose $x-1$ cycles for the left, with the remaining cycles to be on the right.  There are $\binom{x+y-2}{x-1}$ ways to do this.
Arrange the left-cycles in increasing order of the height of their tallest member, and rotate them so that the tallest person is first in each cycle.  Place these cycles at the beginning of the line.
Arrange the right-cycles in decreasing order of the height of their tallest member, and rotate them so that the tallest person is last in each cycle.  Place these cycles at the end of the line.
Finally, put the (overall) tallest person in the middle, between the left-cycles and the right-cycles.
Hence the number of ways to arrange $n$ people in a line with exactly $x$ visible from the left and exactly $y$ visible from the right should be
$$\left[ \begin{array}{c} n-1 \\ x+y-2 \end{array} \right] \binom{x+y-2}{x-1}.$$

Rough notes:
A small sanity check: if $x = 2$ and $y = 1$, we must have the second-tallest person first and the tallest person last, with the $n-2$ people in the middle arranged arbitrarily.  Hence there are $(n-2)!$ possible orders.  Since $\left[ \begin{array}{c} r \\ 1 \end{array} \right] = (r-1)!$, our formula indeed gives $(n-2)!$.
Also, for an example for the map between line-ups and permutations with cycles, suppose $n = 8$, $x = 3$ and $y = 2$.  Consider the permutation (in cyclic notation) of $[7]$ given by $\pi = (5 6) (2 7) (1 3 4)$.  We choose two cycles for the left, say $(2 7)$ and $(1 3 4)$, leaving $(5 6)$ for the right.
Now the left-cycles we rotate so that the tallest person is first, giving $(7 2)$ and $(4 1 3)$ [rotating cycles doesn't change the underlying permutation $\pi$], and then order in increasing order of height: $ 4, 1, 3, 7, 2$.
We then put the tallest person ($8$ - I am naming them after their rank), followed by the right-permutations, which are rotated so that the tallest person is last, giving $4, 1, 3, 7, 2, 8, 5, 6$ as the ordering of the people given by this choice of permutation and division of left-/right-cycles.  Note that here we have $4, 7$ and $8$ visible from the left, and $6, 8$ visible from the right, matching the desired $x = 3$ and $y=2$.
