In Spanish, nominal agreement (concordancia nominal) establishes that the article and the adjectives modifying a noun need to agree in number and gender with it; the pronoun needs to agree with its antecedents and postcedents; and the subject needs to agree with its atributo, which is the subject complement, its complemento predicativo, which is an adjective or noun phrase, or with the participle of its periphrastic passive verb. It could be said that the concept of pronoun-antecedent agreement in English is slightly similar because pronouns need to agree in number with their antecedents (third-person personal pronouns she, her, and hers must agree with a feminine antecedent while he, him, and his with a masculine one), but the grammatical property of gender in Spanish makes nominal agreement more complex.
The general rule of nominal agreement states that two or more coordinated singular nouns or pronouns referring to different entities constitute a group that agrees with adjectives and pronouns in the plural number.
[Al llegar a casa], [Gustavo] [se quitó las zapatillas y medias mojadas].
When coordinated nouns or pronouns differ in grammatical gender, they form a group that agrees with adjectives and pronouns in the masculine gender.
[Los zapatos y las medias] [eran nuevos]. 
Particularities of nominal agreement
1. When two or more nouns that refer to different entities are coordinated, each one should have its own determiner, i.e., article or demonstrative.
[El artista] [pintaba el mural y el cuadro de la misma manera.]
But a single determiner that agrees with the closest noun it modifies in gender and number should be used when two or more coordinated nouns refer to the same thing or person.
[El arqueólogo y profesor] [fue homenajeado por la universidad.]
Only one should be used when a single adjective qualifies two or more coordinated nouns.
[Su dulce mirada y voz] [cautivaron al público.]
And only one should be used when nouns conceived as a unit refer to parts of a set or designate the aspects of a whole.
[La música y baile] [duró toda la noche.] 
2. If an adjective qualifies two or more coordinated nouns and is placed after them, the adjective should be plural and masculine when the nouns have different gender.
[El niño y la niña] [regresaron sucios del parque.]
But when the coordinated nouns are conceived as a unit in which each one designates aspects of a whole, the adjective should agree with the closest one in gender and number.
[Los obreros con horarios y demandas rígidas] [fueron despedidos.] 
3. When an adjective qualifies various coordinated nouns and is placed before them, it should agree in gender and number only with the closest one.
[La escandalosa risa y vestido de la mujer] [captaron la atención de todos.]
Only when the coordinated nouns refer to people or are proper names should the adjective placed before them be plural.
[María] [se emocionó el momento en que vio a sus queridos primo y tío.] 
4. If an adjective qualifies two or more nouns joined by the o conjunction and is placed after them, two alternatives must be considered.
- When the o conjunction denotes exclusion, alternative, or contraposition between the referents designated by the nouns it joins, the adjective should be both plural and masculine if the nouns are of a different gender.
[El pan o la rosca calentitos] [le gustan a Marcela.]
- When the o conjunction joins nouns that refer to a same reality, the adjective should be both singular and masculine if the nouns are of different gender. Normally, the second noun takes no determiner.
[El alcohol o bebida importado] [suele ser mas caro.] 
5. If two or more entities of a same class are referred to by one plural noun, the coordinated adjectives placed after it that assign different characteristics to each of them should be singular.
[Las gramáticas inglesa y española] [son similares en algunos conceptos aunque diferentes en otros.]
But if the adjectives are placed before the noun, they should be singular, and each adjective should have its own determiner.
[La buena y la mala película, clasificadas por la crítica local,] [conmocionaron al público.] 
6. Several coordinated ordinal numbers that modify a noun designate plural entities. The noun should be plural when the ordinals are placed after it.
[José] [compró los departamentos noveno y décimo del edificio nuevo.]
The noun can be either singular or plural when the ordinals are placed before it, yet the singular is preferred.
[El primer y segundo tiempo suplementario del partido] [estuvieron muy emocionantes.] 
7. When a cardinal number that accepts gender is placed after a feminine noun, as an ordinal, it can be masculine and so agree with the elided word número, or it can be feminine and agree with a feminine noun.
[Ellos] [corrieron hasta la cuadra
numero treinta y uno.]
[Ellos] [corrieron hasta la cuadra treinta y una.] 
8. Quantifiers followed by the preposition de and then either a pronoun or a determiner plus a noun constitute partitive constructions. The quantifier designates the part while the second element (determiner included) designates the whole, e.g., uno de los deportistas and una de las secretarias. Both of these elements should agree in gender if they accept this property.
Incorrect: [Juana] [fue una de los hermanos que viajó por todo el mundo.]
Correct: [Juana] [fue una de las hermanas que viajó por todo el mundo.] 
9. Using respectful forms of address, e.g., alteza, majestad, señoría, excelencia, etc., requires determiners and adjacent adjectives to be feminine to agree with the grammatical gender of the nouns, regardless of the sex of the referent.
[Su ilustrada señoría] [determinó que la empresa pagará la multa.]
But adjectives that serve as atributo, which is the subject complement, or as complemento predicativo, which is an adjective or noun phrase, as well as other non-adjacent elements, e.g., pronouns, need to reflect the sex of the referent.
[Todas sus majestades] [estaban vestidos para la fiesta de disfraces.] 
10. Constructions formed by the words de tipo or de carácter plus an adjective are placed after nouns to assign them a characteristic. The adjective must be masculine to agree with either tipo or carácter.
[El editor] [anotó las críticas de carácter gramático en el mismo manuscrito.] 
11. Constructions formed by the pronoun lo and then an adjective plus the relative pronoun que must agree with the noun it refers to in gender and number.
[Debido a lo espantosas que eran las noticias], [la madre] [apagó el televisor.] 
12. Reciprocal constructions are strengthened by the indefinite pronouns uno and otro, which may be preceded by articles and separated by a preposition (a, con, de, en, etc.): se necesitan una a otra, el uno con el otro son inseparables, etc. If the reciprocity involves beings of different sex, both indefinite pronouns should be masculine.
[Paola y Carlos][bailaban encantados el uno con el otro.] 
- ^Diccionario panhispánico de dudas, s.v. “concordancia” accessed August 15, 2019, http://lema.rae.es/dpd/?key=concordancia.