Upvote:2
You should apply from the country of your permanent residence. Because your friend holds a green card and lives in the USA, they can apply in the USA as mentioned by Immihelp.
However, if you are planning to stay in the Schengen area for more than 90 days, you need to apply for a visa from the Embassy of the country which is your sole or main destination.
As to which Schengen state to apply to, read Article 5, Section 1 (including the three bulleted points) of the Schengen Visa Code which provides:
Article 5
Member State competent for examining and deciding on an application
- The Member State competent for examining and deciding on an application for a uniform visa shall be:
- (a) the Member State whose territory constitutes the sole destination of the visit(s);
- (b) if the visit includes more than one destination, the Member State whose territory constitutes the main destination of the visit(s) in terms of the length or purpose of stay; or
- (c) if no main destination can be determined, the Member State whose external border the applicant intends to cross in order to enter the territory of the Member States.
Section 1 deals with regular visas for travel; Sections 2 and 3 (which I have not copied in this Answer) address transit visas.