This is straight replacement of comma with the keyword used in VBA for a line feed vbCrLf. Also, when posting code, used the # button, then paste your code between the two bracketed code markers.

Also tweaked the formatting a bit to make it easier to read.

What are you using this code for, given a line feed is much different than a comma there is likely a better way of doing whatever string dance you need.

Private Sub Worksheet_Change(ByVal Target As Range)
    'Code by Sumit Bansal from https://trumpexcel.com
    ' To allow multiple selections in a Drop Down List in Excel (without repetition)
    ' Edited to allow deselection of item (courtesy of Jamie Counsell)
    
    Application.EnableEvents = True
    
    On Error GoTo Exitsub
    
    If Target.Address = "$A$14" Then
        If Target.SpecialCells(xlCellTypeAllValidation) Is Nothing Then
        
            GoTo Exitsub
        ElseIf Target.Value = "" Then
            GoTo Exitsub
        Else
            Application.EnableEvents = False
            Newvalue = Target.Value
            Application.Undo
            Oldvalue = Target.Value
            Target.Value = Newvalue
            
            If Oldvalue <> "" Then
                If Newvalue <> "" Then
                    If InStr(1, Oldvalue, vbCrLf & Newvalue & vbCrLf) > 0 Then
                        Oldvalue = Replace(Oldvalue, Newvalue & vbCrLf, "") ' If it's in the middle with comma
                        Target.Value = Oldvalue
                        GoTo jumpOut
                    End If
        
                    If Left(Oldvalue, Len(Newvalue & vbCrLf)) = Newvalue & vbCrlf Then
                        Oldvalue = Replace(Oldvalue, Newvalue & vbCrLf, "") ' If it's at the start with comma
                        Target.Value = Oldvalue
                        GoTo jumpOut
                    End If
                    
                    If Right(Oldvalue, Len(vbCrLf & Newvalue)) = vbCrLf & Newvalue Then
                        Oldvalue = Left(Oldvalue, Len(Oldvalue) - Len(vbCrLf & Newvalue)) ' If it's at the end with a comma in front of it
                        Target.Value = Oldvalue
                        GoTo jumpOut
                    End If
        
                    If Oldvalue = Newvalue Then ' If it is the only item in string
                        Oldvalue = ""
                        Target.Value = Oldvalue
                        GoTo jumpOut
                    End If
        
                    Target.Value = Oldvalue & vbCrLf & Newvalue
                End If
jumpOut:
            End If
        End If
    End If
    
    Application.EnableEvents = True
Exitsub:
    Application.EnableEvents = True
End Sub