If one or more, but not all, of the targets of the first ability are illegal when that ability tries to resolve, no counters will be placed on illegal targets. You can't change the distribution you announced when you activated the ability; the excess counters are just lost.

Artwork
Loading artwork…
Ajani, Mentor of Heroes
Journey into Nyx · #145 · EN
Nonfoil—Foil—
Card rules
+1: Distribute three +1/+1 counters among one, two, or three target creatures you control.
+1: Look at the top four cards of your library. You may reveal an Aura, creature, or planeswalker card from among them and put it into your hand. Put the rest on the bottom of your library in any order.
−8: You gain 100 life.
Loyalty 4
Mythic · Illustrated by Aaron Miller
Format legality
Brawl Legal
Commander Legal
Competitive Brawl Legal
Duel Legal
Gladiator Legal
Historic Legal
Legacy Legal
Modern Legal
Oathbreaker Legal
Penny Legal
Pioneer Legal
Timeless Legal
Vintage Legal
Alchemy Not Legal
Future Not Legal
Old School Not Legal
Pauper Not Legal
Pauper Commander Not Legal
PreDH Not Legal
Premodern Not Legal
Standard Not Legal
Standard Brawl Not Legal
Tlr Not Legal
Rulings
Published rulings from the downloaded Scryfall catalog. Source card record · Rules and interactions
You announce how many counters will be placed on each target creature as you activate Ajani's first ability. Each target must receive at least one counter.