Without code
On library click Create new view based on for ex. All items.
Check columns you want to view and sort it how you like.
Under Filter
click Show items only when the following is true
Approval Status ---
is greater than ---
0 << this is for all unpublished(Rejected, Pending, Draft)
Click OK
For Published view create one more view with
Approval Status ---
is equal to ---
0 << this is for published(Approved)
And that's it
Reference
Display Name --- Approval Status
Internal Name --- _ModerationStatus
GUID --- {fdc3b2ed-5bf2-4835-a4bc-b885f3396a61}
Type --- ModStat
FYI
Status --- Internal Value
Approved --- 0
Rejected --- 1
Pending --- 2
Draft --- 3
Scheduled --- 4
EDIT
With code
unpublished-view
In the Code view just paste the following into your View’s XML inside the Query element:
<Where>
<Or>
<Eq>
<FieldRef Name="_ModerationStatus"/>
<Value Type="ModStat">Draft</Value>
</Eq>
<IsNotNull>
<FieldRef Name="CheckoutUser"/>
</IsNotNull>
</Or>
</Where>
EDIT FINAL
If content Approval is disabled you can't see Approval status in edit view under filters so you must add it in code for that 2 new views (published.aspx and draft.aspx).
Open SPDesigner and go to Pages/forms and edit that view. Find <Query>
and paste that code after <Query>
For Draft view:
<Where>
<Or>
<Eq>
<FieldRef Name="_ModerationStatus"/>
<Value Type="ModStat">Draft</Value>
</Eq>
<IsNotNull>
<FieldRef Name="CheckoutUser"/>
</IsNotNull>
</Or>
</Where>
For Publish view:
<Where>
<Or>
<Eq>
<FieldRef Name="_ModerationStatus"/>
<Value Type="ModStat">Approved</Value>
</Eq>
<IsNotNull>
<FieldRef Name="CheckoutUser"/>
</IsNotNull>
</Or>
</Where>
*You can set 3 for Draft and 0 for Approved for _ModerationStatus value.
Save file and that's it. :)