It seems like every time I grill chicken a huge fire always happens.
It doesn't matter if I grill chicken legs or chicken thighs.
What am I doing wrong?
I understand what you're saying...this describes the "barbecued chicken" of my youth. Start your chicken skin-side down (in the case of thighs) over medium-high heat, and keep a close eye on it. If doing legs, you'll have to turn them at least once to sear the other side.
Move the chicken pieces to an unlit part of the grill and close the lid. Grill them indirectly until the internal temperature is 165 and they're no longer pink at the bone. Indirect grilling works great for whole chickens (or other poultry), too. Hope this helps.