Start simple.... All songs follow some kind of pattern, but some the best just come from heart. If you start writing using the I,IV,V guitar chord pattern ie...,(C,F,G or G,C,D) which a lot of songs are written to you can add or subtract from there. Like adding a minor 3rd or a Major 7th, or dim chord in the progression. Yes there are technically rules, but use them as guide lines. Unless of course you are writing music for the Movie industry or jingles for commercials, those have finite patterns, and can not be changed, But if you are writting tunes for yourself, make them yours, by starting simple and expanding from there... Experiment, til you are satisfied.
Hope this helps
95Strat