I want to know how many generations it took to go from King to unknown commoner?
There is an assumption being made in your question that I don’t think you intended to make, but which needs to be clarified. One does not have to be a commoner or low-born to be almost totally unknown when we’re dealing with this time period. In fact, we don’t even known for certain how many children William had, or what some of them did with their lives, if they existed. We know for certain of eight – four sons and four daughters – and there may be one or two other daughters as well. We don’t even know for sure what birth order his daughters are, and these are the children of the king! By the time we reach somebody so far removed that they are considered a “commoner” without noble blood, they are likely to be generations down a path of forgotten minor nobles, none of whom we know anything about. As such, the question is fundamentally unanswerable, since we don’t even know what we don’t know.
The other point I think is necessary to bring up is the potentially differing meanings of “legitimate.” I assume you mean that in the sense of “born within the bounds of marriage,” which is fine, but that was not necessarily a limiting factor on noblesse – especially at the time. William himself was a bastard, and did pretty well for himself, and while he is not known to have any “illegitimate” offspring himself, his eldest son did, and his youngest had a huge number. Succession wasn’t entirely locked in to male-preference primogeniture at the time, and while it had strong support, other things could occur, including the division of titles between multiple children, women inheriting, second sons inheriting while the first lived, etc. All of these are demonstrated within two generations in William’s immediate family.
All that said, let’s take a look at William’s children:
Known sons, in order:
Known daughters, order unknown but some suggest this one:
Other possible children, mentioned but little known or disputed:
TL;DR: If you're interested just in how many generations until we don't know the details, the answer is "one." We don't know all of his children themselves. If you're interested in dynastic descent, following a direct male line, there is no person who fits the bill. William the Conqueror's dynastic male line was extinct within two generations. If you’re interested in any legitimate descendant actually being considered a commoner, then the answer is unknowable. We don’t even know for sure the details of some of William’s own daughters, who were very much considered noble, much less the details of obscure cadets lines generations later.
If no one answers your question, it may be that you're asking something inherently challenging to answer. How would we know about someone we "know nothing/little about"?
You should also take into consideration that any legitimate descendants were unlikely to fall into obscurity. The cadet branches often became distinct noble houses, while heirs and their siblings were usually married into noble houses. It would take a long time for anyone to become a 'commoner' like you say. Now there are plenty of illegitimate children running around at this time and you'd have a better chance of finding someone who fell into obscurity there. But like /u/Temnothorax said, you're basically asking for us to find someone that is not written or talked about. That's inherently somewhat counterintuitive.