My friend has herpes and I kissed him last night but it was only for about two seconds could I get herpes?

Possibly... To some extent this depends on your own immune status. If you have ever had a cold sore (aka fever blister) you may already have antibodies to type 1 herpes simplex virus (hsv) that would protect you against a new infection. Toddlers and small children can also get a hsv-1 infection of the lips and oral cavity that again will usually produce protective antibodies.
Yes. Herpes is transmitted by direct contact. Most people think it's only contagious with active lesions or symptoms such as blisters or sores but studies have shown there are a percentage of people who shed the virus even without symptoms and therefore are contagious. Once a person has herpes, they are always a carrier and potentially can always infect another person, with or without symptoms.