[number + counter] + とも 両方 / どちら + とも [verb (volitional)] + とも [i-adj 〜い → 〜く] + とも [noun] / [na-adj] + であろう + とも
とも after a number and counter means "all" or "both": every one of that many, with none left out. りょうほうとも両方とも and どちらとも work the same way.
With a negative verb, the whole group is negated: "neither", "none of".
It goes with a small number you could count off. A vague amount cannot take it; use みんな or ぜんぶ全部 instead: ×たくさんとも.
After a volitional verb, or an い-adjective in its く-form, とも means "even if". It is written and formal; the everyday form is ても.
The verb takes the volitional form, not the dictionary form: ×たとえ失敗するとも, but たとえ失敗しようとも. A noun or な-adjective takes であろうとも.
These go beyond counting and "even if".
At the end of a sentence, after a plain form, とも means "of course", "certainly". It sounds old-fashioned or hearty.