I know about the calculation for the "Entgeltgruppe" and the following "stufe". My question is: if someone had a contract for, let's say, 3 years then this person needs 2 more years (non paid) to finish the PhD, this 2 extra years can be counted as working experience for the "stufe" calculation?
Probably not. "Work experience" assumes that the person is employed on a position relevant for the position that the "Stufe" is calculated for. From my experience, there is basically no flexibility in bending the interpretation of the TV-L/TV-H (I assume you mean either of them, since they are the relevant "Tarifverträge" for scientific employees).
Can, maybe. Will, extremely unlikely. It would be much easier to try and obtain at least a smallish part-time TVL/TVÖD contract for that time.
Even with TVL/TVÖD, there is some leeway for negotiations as the "treat equal things equal" legal rule applies which means that actual relevant professional experierience must not be disregarded.
Administration is typically very reluctant or even stubborn with anything unusual coming along. But science is the one public service field where this happens due to scientists e.g. moving internationally.
But: a fresh postdoc coming from unemployment will have a lot of competition which is willing to take the offer as it is, and won't have any amount of professional experience that can make up for inconvenient negotiations or non-standard working procedure in administration. Plus, administration may bet that you won't be in a position to sue them. And you could potentially "win" your cause for better Einstufung only with the new professor/director very strongly taking your side against administration. How likely are you to get such help when applying from unemployment?
In fact, you'd anyways have a very hard time to explain how doing private research during unemployment is equal in terms of working experience to someone being employed at a research institution. Keep in mind: for administration working experience also consists of things like having or not working experience with the administrative processes of the new employer, so they do have a point here even if you could show that you accumulated 8 h/day of lone wolf research experience. In addition, you're subject to requirements by social insurance if unemployed or on social insurance money - which do require nonnegligible amounts of time to fulfil, and thus limit the relevant professional experience you can accumulate (at least, were I administration, I'd present you with this argument).
A few more thoughts:
scholarship: I had a scholarship for some of my PhD time and got a very official letter by the university administration saying that my contract goes "on holidays" (beurlaubt) during that time in the interest of my employer (im dienstlichen Interesse). I was told that this ensures that coming back to my contract, they can count the scholarship as professional experience.
However, that was a BAT (predecessor of TVÖD/TVL) contract and back then it was usual to pay PhD students for TAing but hardly anyone was employed for their actual research - I don't know whether this construction would still work nowadays, but it is something worth while to explore in case you get a scholarship.
internships: this won't work: any kind of internship that could potentially lead to professional experience in the TVL/TVÖD sense would be subject to Mindestlohn (minimum wage) - and then it would be easier for the institute to employ you e.g. part-time.
The way TVL/TVÖD is worded, already a smallish part-time contract would help a lot. (BTW, also in terms of social insurance)