No. of onto functions from set A(containing n elements) onto a set B(containing r elements) is equal to the no. of ways of dividing n things into r groups so that no group remains empty if n>=r and zero if n<r.
The formula is rn -rC1(r-1)n+rC2(r-2)n+.....+(-1)r-1rCr-1
Here in your question n=6 and r=4 Substitute them.You will get the answer.