It can add both.
The Markovnikov product is when the free radical halogen add to the most substituted carbon (i.e. the carbon with the least number of hydrogens). The reagents for this to occur is light, heat, and your halogen
The anti-Markovnikov product is where the free radical halogen adds to the least substituted carbon. You have the same reagents like above but you must also have ROOR (peroxide). Peroxide is the key reagents that lets you know that anti-Markovnikov addition is to be expected.