Wash the chicken legs, pat dry with kitchen paper and divide in the joint. Peel the garlic. Cut 2 cloves of garlic into thin slices, finely chop the remaining cloves. Pierce the chicken pieces with a knife in several places and lard them with the garlic slices. Squeeze the lemon. Mix the lemon juice, thyme, mustard, sunflower oil and chopped garlic to a marinade. Salt and pepper them well. Pour the marinade over the chicken and let it stand for 2 hours or more.
Preheat the oven to 200 ° C. Take the chicken pieces out of the marinade, drain well and place on a baking sheet with a high rim or in a baking dish. Save the remaining marinade. Fry the chicken in the middle of the oven for 15 minutes.
In the meantime, wash the potatoes, scrub them well with a kitchen brush (do not peel them) and cut into wedges about 1-2 cm thick. Peel the onions and cut them into thin wedges. Mix the potatoes and onions well with the rest of the marinade and add to the chicken pieces after the first 15 minutes of cooking. Fry for another 45 minutes (until the potatoes are cooked).