PM2.5-O3 composite pollution has become a pressing atmospheric challenge in China. Assessing the impact of territorial spatial landscape pattern on PM2.5 and O3 concentrations within the context of territorial spatial planning will provide ideas for atmospheric governance and spatial planning. Based on the agricultural-urban-ecological space system, this study first reclassifies territorial space within the Yangtze River Delta urban agglomeration (YRDUA) and calculates multilevel and multidimensional landscape metrics. Then, variables are screened by the random forest model and collinearity test. Furthermore, the spatiotemporally heterogeneous impact of selected landscape metrics on PM2.5 and O3 concentrations is explored using the geographically and temporally weighted regression (GTWR) model, with a tradeoff-synergy analysis being conducted to propose planning strategies. The conclusions show: (1) Two pollutant concentrations have both numerical and spatial correlations. The temporal stability of concentrations' responses to metrics is increasing, while the spatial heterogeneity continues to be significant. (2) Aggregation index of agricultural production space (AP_AI) and percentage of forest area (FO_PLAND) are trade-off and synergy factors of coordinated control, respectively. Largest patch index of grassland (GR_LPI) and patch density of other ecological spaces (OT_PD) are individual factors of PM2.5 reduction. (3) Spatial zoning supported by intra-zonal and inter-zonal cooperation policies, and coordinated control guidelines centered around the utilization of agricultural production space, have been advocated. This study aims to provide theoretical supplement and practical support for urban agglomeration's atmospheric governance and territorial spatial landscape pattern optimization.