function hashtags(){
    $tags = get_the_tags($post->ID);
    $count=0;
    foreach ($tags as $tag){
    $count++;
    if (1 == $count) {
    return $tag->name . ', '; 
    }
    if (2 == $count) {
    return $tag->name . ', '; 
    }
    if (3 == $count) {
    return $tag->name; 
    }
    }
}

I'm not sure about php, i am noob, i chose to make this function for showing the title from the first 3 tags of publish, i would like this return: tag1, tag2, tag3.

The function works only return the very first tag, basically put echo not a problem but i'm not going an echo, any idea?

Sorry if I have misinterpreted however i think you are attempting to return a comma separated listing of what they are called discovered by the get_the_tags function? If that's the case this will work:

$tags = get_the_tags($post->ID);
$names = array();
$count = 1;
foreach ($tags as $tag) {
  $names[] = $tag->name;
  if ($count++ == 3) {
    break;
  }
}

return implode(', ', $names);

That code loops with the tags, adds each tag title for an array ($names), and lastly runs the array through [cde] to create the comma separated list.