Only for Scots or for EU citizens - English people have to pay(due to the fact that Scots willing to study in England have to pay for their universities, to it's reciprocal).
I think the requirement is "normally living in Scotland".
(I'm not 100% sure how this is enforced. It rather seems as though getting a cheap flat north of the border and declaring that as your normal residence for the duration of studies could be worthwhile if you can afford it...)
I originally thought this was based on N years of schooling in Scotland for some value of N but after a bit of searching it seems the "normally resident in Scotland" bit isn't really very well defined.
It's debatable whether it's very ethical to do what you suggested - though I don't imagine it's particularly common.
I imagine you'd need to be normally resident at the time you're applying to university, which is a bit more difficult for the average 17-18 year old busy with their final year of school.
The university would presumably also expect a Scotland-resident student to take Scottish exams at a Scottish school, which is a separate system to England, so even more hassle.
I don't know Scotland's rules, but other places I've lived usually required living in a place for 6 months or a year before starting your studies in order to be considered resident for tuition.
(I'm not 100% sure how this is enforced. It rather seems as though getting a cheap flat north of the border and declaring that as your normal residence for the duration of studies could be worthwhile if you can afford it...)