Hi Sotiras
It's a good question, and the answer isn't easy. Consider a lineout just outside the 22, with the ball won by the defence, passed back to the 10 who kicks. The ball makes it to the 10m line, where the opposing winger catches it infield, but with a foot in touch.
The law is: [LAWS]19.2(c) A player must not take a quick throw-in after the lineout has formed. [/LAWS] That law is itself informed by various provisions within Law 19, but specifically 19.8:
[LAWS]19.8(a) Minimum. At least two players from each team must form a lineout.
19.8(d) When the ball is in touch, every player who approaches the line of touch is presumed to do so to form a lineout.
19.8(h) Where the lineout players must stand. The front of the lineout is not less than 5 metres from the touchline. The back of the lineout is not more than 15 metres from the touchline. All lineout players must stand between these two points.
19.8(l) Two single straight lines. The lineout players of both teams form two single parallel lines each at right angles to the touchline[/LAWS]
It is also relevant that a lineout always takes place on the Line of Touch. So in the scenario above, the line of touch is in line with where the #10 kicked the ball ("Taken Back In!"). There would need to be two players from either side, forming lines parallel to each other, in line with that spot before the QTI can be disallowed as a result of the lineout being "marked". The mass of players milling around the previous lineout do not count, as that is not the new line of touch. Nor would it count if there happened to be two from each team "marking" the position in line with where the ball was caught, as no lineout can legally form there (it not being the Line of Touch).
If the original lineout had taken place inside the 22, then the LOT would be where the ball was caught. So again, the mass of players milling around the old lineout wouldn't count as your 2 from each side. 19.8(h) makes it clear that the player more than 15m from touch, or less than 5m from touch, cannot be considered as forming the lineout.