Just a quick note if you’re using Unity 2019 onwards (I believe). You’ll need to download the 2D Tilemap Extras from Unity’s Git repo. Until you do you won’t be able to create a Rule Tile in the Project window.
EDIT: To get the Rule Tiles working that include rotating for corners, you’ll need to click the grey circle in the middle of the grid where you set your rules with the green arrows or red crosses. Once it displays an arrow your’e good to go, easy as that! (Unity documentation here)