It allows max three digits per part of version number. If you want to use more digits then add two zeros to major multiplication an one zero to minor multiplication for each digit (I hope it's clear).
select t.*
from yourTable t
join (
select name, max(major * 1000000 + minor * 1000 + revision) as ver
from yourTable
group by name
) t1 on t1.ver = (t.major * 1000000 + t.minor * 1000 + t.revision)
Result:
name major minor revision
p1 1 1 4
p2 2 5 0
p3 3 4 4