Lets set up an example. We have two people, Joe and Elaine, and they can each gather grapes or water. Joe can gather 8 grapes per hour, or get 4 gallons of water. Elaine can gather 10 grapes per hour, or get 10 gallons of water.
The easiest concept to look at first is absolute advantage. Absolute advantage means that a person or country can produce more in a given time frame than someone or something else. Because Elaine can gather more grapes (in a specific time frame) than Joe, she has the absolute advantage in grapes. Also, Elaine can get more water in an hour than Joe, so she also has the absolute advantage in water. Elaine has the absolute advantage in both grapes and water, because she can produce/gather more of each per hour than Joe can.
Now, lets consider comparative advantage.
Comparative advantage means that a person or country has a lower opportunity of production/gathering than someone or something else. First we have to calculate the opportunity cost of a gallon of water for Joe, we can see that if he gives up 2 grapes (from 8 grapes divided by 4 gallons of water) he gets a gallon of water. So his opportunity cost for a gallon of water is 2 grapes. Now look at Elaine, she has to give up 1 grape to get a gallon water water (from 10 grapes divided by 10 gallons of water). Elaine has the lower opportunity cost for water, so she has the comparative advantage in water.
Likewise, Joe's opportunity cost for grapes is 1/2 gallon of water, and Elaine's is 1. Therefore Joe has the comparative advantage in grapes.
Remember: When solving for comparative advantage, each party will have the comparative advantage in one good, while it is possible for one party to have the absolute advantage in both. The only time neither party will have a comparative advantage is when their opportunity costs are equal. It is never possible for one party to have the comparative advantage in both goods!