Peel both heads of garlic. Mince half of the cloves and reserve the other half for later.
Place the chicken legs in a large bowl and top with the minced garlic, olive oil, cilantro, juice of one lemon, salt, cumin, coriander, allspice, sumac and cinnamon.
Using a pair of tongs, move the chicken around to make sure all pieces are fully coated with the marinade. Cover and refrigerate for 1 hour up to 8 hours. The longer the chicken marinades, the tastier it'll be.
When you're ready to cook, take the chicken out of the refrigerator and preheat the oven to 425 degrees F. Coat a baking dish large enough for the chicken legs with cooking spray or olive oil.
Place the sliced onion and the reserved garlic cloves in the baking dish. Arrange the marinated chicken legs on top.
Slice the remaining lemon and tuck the lemon sliced in between the chicken legs.
Bake at 425 degrees F for 45 to 50 minutes until the chicken is fully cooked and an instant thermometer inserted into the chicken registers at 165 degrees F.
If desired, turn on the broiler for the final 5 minutes for more color and some crispy skin.