unemancipated minors
Unemancipated minors can buy a house in their name, but they will need the permission of their parents or legal guardians to do so. They must also be present before a notary, at the time of sign the sales contractsince they will be acting on your behalf.
the same will happen if it is an inherited house: they will need legal representation. However, in both cases the house will be registered in the Land Registry on behalf of the minor.
Emancipated minors
Emancipated minors, that is, those young people who are between 16 and 18 years old and live independently with the express consent of their parents -or by judicial decision-, they may buy a house without parental consent.
The same will happen when accepting an inherited house: you will not need the consent of your parents to do it.