I wanted to know if the @r command works with the [name=] specification, aim trying to make a underwater map with randomized fish using invisible squids and i want to only select the ones named squid (meaning the unnamed ones since a squid's default name is squid)
Yes it does, but you have to specify the type of mob it is, or it won't target entities. As per the wiki:
When used without the
@ralways targets a random player. The
typeargument can be used to target non-player entities [...]
Here is a example:
/tp @r[type=Squid,name=Random] ~ ~3 ~
This would teleport a random Squid with the name "Random" 3 blocks up. Hope this helps!