I worked in US for 5 months last year, do I need to pay federal tax for 2018?

Came to US on August.

I have W2 from employer for Aug to Dec 2018 (5 months).

Do I need to pay federal tax for year 2018?

Is there any tax I can refund since I stayed only for 5 months in year 2018?