It follows from the definition of ‘illegal stay’, set out in Article 3(2) of Directive 2008/115, that any third-country national who is present on the territory of a Member State without fulfilling the conditions for entry, stay or residence there is, by virtue of that fact alone, staying there illegally, without such presence being subject to a condition requiring a minimum duration or an intention to remain on that territory. Nor is the fact that such presence is merely temporary or by way of transit among the grounds, listed in Article 2(2) of the directive, on which Member States may decide to exclude an illegally staying third-country national from the directive’s scope.

Article 2(1) and Article 3(2) of Directive 2008/115 on common standards and procedures in Member States for returning illegally staying third-country nationals must be interpreted as meaning that a third-country national is staying illegally on the territory of a Member State and therefore falls within the scope of that directive when, without fulfilling the conditions for entry, stay or residence, he passes in transit through that Member State as a passenger on a bus from another Member State forming part of the Schengen area and bound for a third Member State outside that area.

Directive 2008/115 on common standards and procedures in Member States for returning illegally staying third-country nationals must be interpreted as precluding legislation of a Member State which permits a third-country national in respect of whom the return procedure established by that directive has not yet been completed to be imprisoned merely on account of illegal entry across an internal border, resulting in an illegal stay.

Since such a third-country national falls, under Article 2(1) of Directive 2008/115, and without prejudice to Article 2(2), within the directive’s scope, he must be subject to the common standards and procedures laid down by the directive for the purpose of his removal, as long as his stay has not, as the case may be, been regularised. By virtue of those standards and procedures, such a third-country national must be the subject of a return procedure, the order of whose stages corresponds to a gradation of the measures to be taken in order to enforce the return decision and which permits, so far as concerns deprivation of liberty, at the very most detention in a specialised facility, a measure which is, however, strictly regulated, pursuant to Articles 15 and 16 of Directive 2008/115, in order to ensure observance of the fundamental rights of the third-country nationals concerned.

In addition, it is clear from Article 2(2)(a) of Directive 2008/115, which permits Member States, in particular, not to apply the directive to third-country nationals who are apprehended or intercepted by the competent authorities in connection with the irregular crossing of the external border of a Member State and who have not subsequently obtained an authorisation or a right to stay in that Member State, that that provision relates exclusively to the crossing of a Member State’s external border, as defined in Article 2(2) of the Schengen Borders Code, and therefore does not concern the crossing of a common border of Member States forming part of the Schengen area. That provision thus cannot permit the Member States to exclude certain illegally staying third-country nationals from the directive’s scope on the ground of illegal entry across an internal border. Furthermore, since that provision concerns only the case where those nationals have entered the territory of the Member State concerned and not the case where they have sought to leave that territory and the Schengen area, it likewise does not permit such nationals to be excluded from the directive’s scope because they have been intercepted and apprehended in the latter situation.

That interpretation of Directive 2008/115 also applies where the national concerned may be taken back by another Member State pursuant to an agreement or arrangement within the meaning of Article 6(3) of the directive. That article cannot be interpreted as laying down an exception to the directive’s scope, which would be additional to those set out in Article 2(2). In accordance with the wording, scheme and purpose of Directive 2008/115, the situation of such a national remains governed by the directive and the Member State which decides to transfer him to another Member State pursuant to Article 6(3) acts within the framework of the common standards and procedures established by the directive.

(see paras 61, 62, 68, 69, 71, 77, 78, 82, 83, 86, 93, operative part 2)