First the basics. Baseball rosters are 40 men. There are three locations that a player on the 40 man roster can be.
- the Disabled List (or one of a handful of other inactive statuses such as bereavement, paternity or the concussion DL)
- the active 25 man roster (or 26 on Double Header days)
- the minor leagues
When a player is moved from the active roster to the minor leagues he goes through a process called "optioning." This is a bookkeeping maneuver to move his roster spot and contract from the active MLB roster to the Minor League rosters (usually AAA, but sometimes lower levels).
Usually, a team gets 3 years where they can freely call up and send down a player. Most of the time this is the first three years of a player's service time, but it can continue longer. The rules are that any player who is sent down and spends 20 or more days in the minor leagues burns up an option year. It does not matter whether a player is ever on the 25 man roster, if he's on the 40 man, and playing in the minors, he's probably burning an option year. (Players are often placed on the 40 man roster prior to their callup in order to protect them from the rule 5 draft.)
A player who is currently in an option year can be called up and sent down freely. A player who does not have any options remaining must pass through the waiver wire before he can be sent to the minor leagues (this process removes him from the 40 man roster as well).
A fourth option year can be had if a player does not accrue 90 days of service time with an active professional club during his first year as a professional (so someone who only played rookie ball during his first professional year)
A player with 5 years of ML service time cannot be sent down to the minors without his consent regardless of whether or not he has cleared waivers or has options.
Source