Here are the basics:
Marbles are arranged into four rows. Row 1 has one marble, row 2 has three marbles, row 3 has five marbles, row 4 has seven marbles. Different versions of the game have different numbers of rows and marbles.
Two players go back and forth, taking removing as many marbles as they wish from whichever row they wish. The winner is the person who forces their opponent to take the final marble.
It's a math game, and it's an important part of an upcoming episode!