How many different combinations of $X$ sweaters can we buy if we have $Y$ colors to choose from?
To help build some intuition, how about a simple example?
Say we walk into a store to buy three sweaters. The store stocks two colors of sweater, red ($R$) and blue ($B$). In this case $X=3$ and $Y=2$. What possible selections of colors can we make for the set of three sweaters?
The first thing to note is that order does not matter. It doesn't matter if we chose Sweater 1 to be red and Sweaters 2 and 3 to be blue ($RBB$), or Sweaters 1 and 2 to be blue and Sweater 3 to be red ($BBR$). So a selection of $RBB$ will be the same as $BBR$.
Very well, how then will we find a systematic way of listing and counting all the possible selections we can make?
The method Stefan posted is the "usual" way of doing this; I will use essentially the same method, but perhaps explain it slightly differently.
We will want to have $X=3$ sweaters when we eventually walk out of the store. Let's represent them by $3\ O$'s:
$OOO$
Now what is meant by "partitioning" is this:
We have $Y=2$ colors to choose from. We will thus divide our line of $3$ $O$'s into $2$ distinct groups by putting a bar $|$ in between them, so that any $O$'s to the left of the bar will be red, and those on the right will be blue. So for example, the selection $RBB$ given earlier will be represented by $O|OO.$
As another example, the selection of $3$ red sweaters would be represented as $ OOO|$ (all $3$ $O$'s are on the left of the bar, and there are none on the right.)
So we can represent each of our selections with this combination of $3$ $O$'s and $1$ $|$. Try representing the selection $RBR$. (Answer below):
Remember that order does not matter, so we just put the two red ones on the left of the bar, and the blue one on the right, like so: $OO|O$
This is what is meant by partitioning $X$ objects into $Y$ categories. The $X$ objects are represented by a string of $X$ $O$'s $ \underbrace{OO\cdots O}_X,$ into which we insert $(Y-1)$ $|$'s so that we divide the list of $O$'s into $Y$ different categories $ \underbrace{O\cdots O}_{1st\ category} \stackrel{1st}{|} \underbrace{O\cdots O}_{2nd\ category} \stackrel{2nd}{|} \cdots \stackrel{(Y-1)th}{|} \underbrace{O\cdots O}_{Yth\ category}. $
Note that a category may not be filled, for example if we had three colors red, blue and green, we could still choose the selection $RBB$, which would be represented by $3$ $O$'s and $2$ $|$'s like so: $O|OO|$ as explained by the diagram below: $ \underbrace{O}_{red}|\underbrace{OO}_{blue}|\underbrace{}_{green} $
Hopefully the idea of partitioning $X$ objects into $Y$ categories is now clear. Back to the example, how many ways can we do this if $X=3,\ Y=2$?
Well, we want to permute $3$ $O$'s and $1$ bar (remember that if we have $Y$ categories we will need $(Y-1)$ bars), so hopefully you've done enough basic combinatorics to know how to do this?