Batteries are more sensitive to age than miles.
It seems that battery life for an OE lead-acid battery installed in most vehicles is about 4-5 years. AGMs last a bit longer. Since our diesels use more current to start when cold (with the preheating cycle), that life will probably be closer to 4 years.
If you plan to park it for more than a couple weeks, put a battery tender on it. Nothing is harder on a lead-acid battery than letting it get deeply discharged and then sit in a discharged state. That accelerates plate sulfation. Lead acid batteries need to keep their charge topped up for maximum life.
I’ll note that a car I own, which originally came with a Ford-branded Optima battery (spiral cell AGM design), lasted 15 years!