if you are applying for citizenship, the first question on the n400 form is:

A. Your current Legal Name.
Family Name (Last Name)

Given Name (First Name)

Full Middle Name (If Applicable)

ok, lets look at each of this questions what they mean

there are some countries in the world that use 'PATERNAL' and 'MATERNAL' names. for example, in latin american they use the father's last name first and the mothers last name secon with a first name and a middle name. for example this is your name on your birth certificate:

Francisco Diego Hernandez Lopez

as you can see from our example, we have a total of four names, so which one is the first middle and last? here is the answer:

First Name = Francisco
Middle Name = Diego
Last Name = Hernandez Lopez

Yes, you must include both last names as your last name as it appears on your birth certificate.

the rule of thumb here, is to make sure your names match whats on your birth certificate from your home country. this will avoid any confusion in the future with the USCIS

if it doesn't match what is on your green card, the next question on the form will ask you to write your name exactly as it appears on your green card