How can I filter with multiple condition in aggregation bucket?

I want agg bucket which filtered multiple condition like below.
but It is returning Expected [START_OBJECT] error

{"error":{"root_cause":[{"type":"parsing_exception","reason":"Expected [START_OBJECT] under [filter], but got a [START_ARRAY] in [in_global_gen_filtered]","line":31,"col":21}],"type":"parsing_exception","reason":"Expected [START_OBJECT] under [filter], but got a [START_ARRAY] in [in_global_gen_filtered]","line":31,"col":21},"status":400}

How can I filter with multiple condition in aggregation bucket?

curl -X GET "localhost:9700/some_index/_search" -H 'Content-Type: application/json' -d'

{
  "query": {
    "function_score": {
      "query": {
        "bool": {
          "filter": [
            { "terms":{ "some_field_1": [ "y" ] } },
            { "terms":{ "some_field_2": [ "y" ] } }
          ]
        }
      },
      "functions": []
    }
  },
  "from": 0,
  "size": 10,
  "aggs": {
    "in_global": {
      "global": {},
      "aggs": {
        "global_gen": {
          "terms": {
            "field": "gender",
            "size": 30,
            "shard_size": 30
          }
        },
        "in_global_gen_filtered": {
          "filter": [
            { "terms":{ "some_field_3": [ 'y' ] } },
            { "terms":{ "some_field_4": [ 'y' ] } }
          ],
          "aggs": {
            "global_gen_filtered": {
              "terms": {
                "field": "gender",
                "size": 30,
                "shard_size": 30
              }
            }
          }
        }
      }
    }
    
  }
}

'