In the case of and, it's very simple. Regardless of whether the nouns are singular or plural, joining them with and "creates" plurality.
The cat(s) and the dog(s) are under the bed.
Again, whether cat and dog are individually singular or plural will have no effect on the verb. The verb will consistently be plural following nouns joined by and.
Or is slightly more complex. Two nouns joined by or do not create plurality. Instead, the verb will be made singular or plural by the noun closer to the verb.
The cat or the dog is under the bed.
In this first sentence, "dog" is singular and therefore we use the singular verb form "is."
The cats or the dog is under the bed.
In this second sentence, you can see that cats is now plural, but the verb is unaffected. The verb form depends entirely on dog because it is the noun closer to the verb.
The cat or the dogs are under the bed.
For this third sentence, now that dogs is plural, the verb changes to the plural form are.
Check here for a guide on subject-verb agreement, including what I covered about and and or.