Probably around the 3 months, maybe 6 months. It's also not just about time. Smarter people than me would have to answer, but the general principle, following the spirit of employment law, seems rather obvious.
Imagine I started a warming-up business, where you could sign a short contract for warm french fries and warm cooked meat. But I'd insist it's not a restaurant, so that any hygene rules do not apply to me.
They have! Lawmakers and judges that are better at this than both of us put together have been wrangling over it for decades. The spirit (and letter) of the law is pretty clear that length of service is not a consideration here - in fact, HMRC don't include it in their CEST tool, which is very maximalist.
The actual tests, in law, are supervision direction or control, mutuality of obligation and right of substitution. IT contractors are generally weakest on substitution - it's written in to contracts as a fig leaf, but very seldom triggered. If a court finds that actual working practices differ from what's written in the contract they'll prioritise working practices in determining employment status. The clause I had to modify most often was one attempting to control working hours - because that would point to supervision direction or control. It's amazing how many agency contracts had that baked in.
Imagine I started a warming-up business, where you could sign a short contract for warm french fries and warm cooked meat. But I'd insist it's not a restaurant, so that any hygene rules do not apply to me.