Capital gains are included in AGI. Capital gains (line 14 of Schedule 1) are included in the total additional income on line 22 of schedule 1, then transferred to line 6 of form 1040. Note that the total of lines 1 thru 6 of form 1040 constitute your AGI.
Capital gain are not used in calculating modified AGI (MAGI). There are actually several different MAGIs, depending on which tax attribute is being calculated.