If the parents are separated or divorced, the custodial parent is responsible for filling out the Free Application for Federal Student Aid (FAFSA). The custodial parent for federal student aid purposes is the parent with whom the student lived the most during the past 12 months. (The twelve-month period is the twelve month period ending on the FAFSA application date, not the previous calendar year.)
Note that this is not necessarily the same as the parent who has legal custody.