Husk, 2424 22 bytes
Edit: -2 bytes thanks to Razetime
m?o`:'*ssȯ#2`m₁¹oa-₁'*ssȯ#2`m₁¹≠₁
fṗḣ
Husk doesn't particularly like mixing numerics + characters.
fṗḣ # helper function: primes up to input
m?o`:'*ssȯ#2`m₁¹oa-₁ # main function:
m ₁ # for each element in primes up to input
oa- # get the absolute differences to
`m₁¹ # all primes up to input
ȯ#2 # and count how many '2's there are:
? # if it's zero
s # convert it to a string
o`:'*s # otherwise convert it to a string & prepend with '*'