If $A$ and $B$ are two sets having $m$ and $n$ elements such that $1 \leq n \leq m$
Then, no. of surjection $=\displaystyle\sum_{ r =1}^{ n }(-1)^{ n - n } C _{ r } r ^{ m }$
Number of surjection from $A$ to $B$
$=\displaystyle\sum_{ r =1}^{2}(-1)^{2-2} C _{ r }( r )^{4}$
$=(-1)^{2-1}{ }^{2} C _{1}(1)^{4}+(-1)^{2-2}{ }^{2} C _{2}(2)^{4}=-2+16 $
$=14$