When the Dept. of Defense was created by The National Security Act of 1947, part of the law included this, anyone “who has within ten years been on active duty as a commissioned officer in a Regular component of the armed services shall not be eligible as Secretary of Defense." This was part of the long-standing constitutional idea that civilians would have control of the military.
That rule was soon waived by Congress to let George C. Marshall serve but he had held several post-military government jobs. Therefore there is a precedent that Congress can waive the restriction on Mattis serving as Sec.
of Defense, the question is whether Democrats are going to be interested in going along with that and, if not, whether they can do anything about it.
Democrats opposed
Democratic Senator Kirsten Gillibrand who serves on the Senate Armed Services Committee, has stated publically that although she has great respect for retired General Mattis and his long service in uniform, she will oppose his nomination on the grounds that he is too closely tied to the military to be considered a civilian yet.
Change in law
In 2008 the congress changed the 10 year rule to 7 years as the time a military person has to wait before being named civilian head of the Department of Defense. However, General Mattis only retired in May of 2013 so he doesn’t qualify even under the modified rule unless Congress again waives the rule entirely.
Gen. Mattis stand on Iran
One reason Democrats may oppose Mattis’ appointment, besides the existential fact that it is against the whole concept of civilian control of the military, is that he opposes the iran Nuclear Deal. In fact he opposed it so vocally that it is rumored that he was forced to retire 5 months earlier than expected because he was so publically at odds with President Obama on the Iran deal.
This April Mattis told the Center for Strategic and International Studies, that Iranian regime is still the most dangerous threat in the Middle East. “The Iranian regime, in my mind, is the single most enduring threat to stability and peace in the Middle East,” Mattis said, according to a report in The Military Times. “For all the talk of ISIS and Al Qaida everywhere right now… they’re a very serious threat.
But nothing is as serious in the long term enduring ramifications, in terms of stability and prosperity and some hope for a better future for the young people out there, than iran.”
Trump knows more about ISIS than the generals
Many people recall that Candidate trump once famously told an interviewer that he knew more about ISIS than the generals which makes it seem a bit peculiar that he keeps looking to the military for his staff. Of course he has also looked to Goldman Sachs’ Steven Mnuchin for Treasury Secretary to help him “drain the swamp," as President Elect Trump keeps saying.