There was also a separate charge against Rittenhouse for carrying it that was dismissed at the very end of the trial due to a confusingly-worded law. But Rittenhouse wasn't carrying anything that counted as a short-barreled rifle. The judge ruled that the law did not apply to what Rittenhouse did, since the prosecutor did not allege any facts that the jury could have agreed with that would have made him guilty. The prosecutor was apparently going by the caption of the law (which says something about guns held by someone under 18) but that has no legal effect and the judge admonished him for trying to pull a fast one again.
This was covered right before it went to the jury as I recall, if you want to look up videos of how it went down at trial.
The defense successfully argued that the phrasing meant rifles and shotguns with a barrel length of sixteen inches or more were exempted.
Having the weapon at his age wasnt illegal?