For the brine: Bring 4 cups water to a boil in a medium saucepan. Remove from the heat and stir in the salt, sugar, peppercorns, 5 rosemary sprigs, 5 thyme sprigs, the crushed garlic, and three-quarters of the lemon slices until the sugar and salt dissolve. Pour the brine into a large bowl and stir in 8 cups cold water. Submerge the chicken in the brine, cover with plastic wrap, and refrigerate for 24 hours.
In a small bowl, combine the sumac with the lemon zest. Drain the chicken, discard brine, and pat dry with paper towels. Using your fingers, gently separate the skin over the chicken breasts and thighs and stuff the sumac and lemon zest between the skin and meat. Season with salt and pepper.
Heat the oven to 400°. Drizzle the 2 heads of garlic with 1 tablespoon of the oil, and then wrap them in foil. In a medium bowl, toss the remaining rosemary and thyme sprigs with the minced garlic, remaining lemon slices, and 3 tablespoons olive oil. Rub the outside of the chicken with the oil, and stuff the cavity with the herbs and lemons. Transfer the chicken to a roasting pan with the heads of garlic, and roast until golden brown and an instant-read thermometer inserted into the thigh reads 160°, about 1 hour and 10 minutes.
Transfer the chicken to a cutting board and let stand for 10 minutes. Unwrap the garlic heads, cut in half crosswise, and squeeze the cloves into the roasting pan. Whisk the garlic with the pan juices, scrape into a bowl, and serve the sauce alongside the chicken.