Let xi be the number of marbles in the ith compartment. Then u have to find out the number of positive integer solutions of x1+x2+x3+x4+x5+x6=12. To know how to find this, see this:
http://www.askiitians.com/iit-jee-algebra/permutations-and-combinations/derangements-and-multinomial-theorem.aspx