Preheat the oven to 350 degrees F. Place the bread on a large baking sheet and toast, stirring periodically, until dried out and crisp, approximately 20 minutes. Alternately, the cubed bread can be left in a large bowl overnight to dry out. Allow to cool and then transfer to a large bowl.
Heat the olive oil in a large saucepan or Dutch oven over medium-low heat. Keep a liquid measuring cup full of water nearby. Add the onions and a pinch of salt to the pan and cook, stirring frequently, until the onions begin to brown. Turn up the heat to medium and continue caramelizing the onions. As a glaze develops on the bottom of the pan, add a few tablespoons of water and scrape up the brown bits, incorporating them into the onions. The heat will cause the water to evaporate. Repeat this process for approximately 25-30 minutes, keeping a close eye on the onions to make sure they don't burn. When the onions have turned a dark brown color and taste more bitter than sweet, remove from the pan and set aside. The onions should be reduced down to approximately 2 cups.
Add the butter to the same pan over medium-high heat. Once the butter has melted, add the celery and apples, stirring to coat with the butter. Cook for approximately 10-15 minutes, stirring periodically, until the ingredients are tender and slightly caramelized.
Preheat the oven to 350 degrees F. Lightly grease a 9x13 pan with softened, unsalted butter or baking spray.
Add the caramelized onions and the celery apple mixture to the bread, tossing to combine (clean hands are the best tool for the job). Add in 1 1/4 cups stock, the parsley, sage, thyme, rosemary, salt and pepper. Toss the ingredients together until evenly combined.
Whisk together the remaining 1 1/4 cups stock with the two eggs. Add to the bread mixture and fold everything together. Gently press the mixture evenly into the prepared pan and cover securely with aluminum foil. Bake for 40 minutes. (Can be made 1 day ahead. After removing from the oven, uncover and cool. Cover and refrigerate overnight).
Remove the foil and bake uncovered for an additional 40-45 minutes, until the top is browned. (Add an additional 10-15 minutes if chilled).
Notes
Make ahead: toasted bread and caramelized onions can be prepared up to 48 hour in advance.If you're comfortable multi-tasking in the kitchen, save time by using separate pots to cook the caramelized onions and celery/apple mixture at the same time.Adapted from Epicurious.