You need to use bool queries. Important to note that for your "contains exactly these phrases" how that works depends on what analyzers you have applied to the body field.
https://www.elastic.co/guide/en/elasticsearch/reference/5.6/query-dsl-bool-query.html
For example:
{
"query": {
"bool": {
"must": [
{"match": {"body": "a"}},
{"match": {"body": "b"}},
{"match": {"body": "c"}},
{"match_phrase": {"body": "g h i"}},
{"match_phrase": {"body": "j k l"}}
],
"should": [
{"match": {"body": "d"}},
{"match": {"body": "e"}},
{"match": {"body": "f"}}
],
"must_not": [
{"match": {"body": "m"}},
{"match": {"body": "n"}}
]
}
}
}