A legal name is the name an authority uses to identify a person for a particular official purpose. Match the document the form asks for and follow its instructions for middle names, multiple surnames, and suffixes.

How Social Security handles names
For U.S. Social Security number records, the agency defines the legal name as the first and last names. Its instructions treat a middle name and suffix as separate fields. That definition is specific to Social Security number processing.
Social Security Administration name instructions
When your documents show different names
A name may change after a court order, marriage, or another recognized event. If your documents show different versions, check which evidence the issuing agency requires before submitting the form. Ask the agency how to enter a single name, a compound surname, or a name that does not fit its fields.
Related reading. Given Name · Middle Name · First Name Vs Last Name