Mishneh Torah — Negative Mitzvot מצוות לא תעשה, Chapter 311
The full Hebrew text of Mishneh Torah, Negative Mitzvot, Chapter 311, with English translation by Maimonides (Rambam).
שלא יתחייב חתן בדבר מצורכי רבים כל שנתו, כגון צבא ושמירת החומה וכיוצא בהן, שנאמר "לא ייצא בצבא, ולא יעבור עליו לכל דבר" (דברים כד,ה).
For a groom not to be held liable for any type of public service - e.g., army, guarding the walls [of a city], and the like - as [Deuteronomy 24:5] states: "He shall not go out to the army, nor be charged with any duties."