State laws for HOV (high occupancy vehicle) and carpool lanes differ however normally a child does count as an occupant. With certain exceptions, carpool lanes are reserved for vehicles carrying multiple occupants.
An occupant is typically defined as any person who occupies one seat in the vehicle. So both a newborn infant in an infant car seat and a 2 year old child in a child seat would usually count as occupants so that you could drive in a carpool lane. Pregnant mothers count as one occupant though because they only occupy one seat in a vehicle.
Since the laws governing use of carpool or HOV lanes vary by state you can contact your state's Department of Motor Vehicle (DMV) to find out what they consider an occupant and if your 2 year old falls under their definition for the carpool lane. She should unless your state has some goofy laws regarding car occupants for HOV lanes.
Here is some addition information on HOV lanes in California and Florida just for information purposes.
The California driver's handbook notes that a carpool lane is a special freeway lane only for motorcycles, buses, and/or carpools. You may use a carpool lane or on ramp if your vehicle carries the minimum number of people required for the carpool lane or you drive a low-emission vehicle displaying a special DMV issued decal. Motorcycle riders may use designated carpool lanes, unless otherwise posted.
In CA signs at the on ramp or along the freeway tell you the minimum number of people required for the carpool and the hours the carpool requirement applies. The pavement in this lane is marked with a diamond symbol (◊) and the words "Carpool Lane." These lanes are also known as high-occupancy vehicle (HOV) lanes. Do not cross over double parallel solid lines to enter or exit any carpool lane except at designated entry or exit places.
In Florida, Statute 316.0741 lists what a High-occupancy-vehicle lane or HOV lane means. Here it states that the HOV is a lane of a public roadway designated for use by vehicles in which there is more than one occupant unless otherwise authorized by federal law.