The eight consciousnesses are formless and without appearance; they are not material phenomena (rūpa). There is no physical contact between them and material phenomena. Therefore, consciousnesses do not reside inside, outside, or in the middle of the material body (rūpa-kāya). If consciousnesses were inside the material body, then by disassembling this material body, cutting it apart piece by piece, one should be able to see the consciousnesses. However, even if the material body is completely cut into pieces, no consciousness is seen to emerge. Even if the subtle material faculties (indriya) in the back of the head are disassembled, the eight consciousnesses cannot be found. Thus, consciousnesses are not inside the material body.
If consciousnesses were outside the material body, outside the body is empty space. Consciousnesses cannot exist within empty space, as they are of a different nature; they cannot mutually reside within each other. Even if consciousnesses were in empty space, they would have no relation to you—they would belong to no one, nor could they be shared by everyone. If consciousnesses were on another person's body, they would belong to that person. If they were on inanimate objects, smashing the objects would still not reveal them. Therefore, consciousnesses are not outside the material body.
If consciousnesses were in the middle of the material body, no middle location can be found. If they were on the surface of the material body, that still belongs to the inside of the body, not the middle. Any specific location belongs to the inside of the body, not the middle. Therefore, consciousnesses are not inside, outside, or in the middle of the material body.
For specific reference, see the first volume of the Śūraṅgama Sūtra, where the World-Honored One explains that the six consciousnesses are not inside, outside, or in the middle of the material body. The seventh and eighth consciousnesses are the same as the six; none of them are inside, outside, or in the middle of the material body. Material phenomena (rūpa-dharma) and non-material phenomena (arūpa-dharma) cannot have physical contact; therefore, non-material phenomena cannot reside inside, outside, or in the middle of material phenomena.
Then someone might ask: So where exactly are the eight consciousnesses? Surely they must exist somewhere? The eight consciousnesses certainly exist at their respective functional locations, but they are not seen with the eyes because they are formless and without appearance. As for the specific functions of each of the eight consciousnesses, one should diligently contemplate them through practice. When the time is right, one will realize each consciousness and then know where each resides. Among them, the first six consciousnesses are relatively easy to realize, but the seventh and eighth consciousnesses are extremely difficult to realize, requiring the fulfillment of considerable causes and conditions.